Skip to content

Commit

Permalink
fix: point actions to ansys/actions (#263)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Revathy Venugopal <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Fernandez <[email protected]>
Co-authored-by: Maxime Rey <[email protected]>
Co-authored-by: Roberto Pastor Muela <[email protected]>
Co-authored-by: Alex Kaszynski <[email protected]>
Co-authored-by: Revathyvenugopal162 <[email protected]>
  • Loading branch information
8 people authored May 16, 2023
1 parent 3faf0ad commit 3927545
Show file tree
Hide file tree
Showing 57 changed files with 317 additions and 258 deletions.
File renamed without changes.
30 changes: 30 additions & 0 deletions .ci/ansys-actions/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Pyactions core
==============
|ansys| |python| |pypi| |CI-CD| |MIT| |black|

.. |ansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?labelColor=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
:target: https://actions.docs.ansys.com/
:alt: PyAnsys

.. |python| image:: https://img.shields.io/badge/Python-%3E%3D3.7-blue
:target: https://pypi.org/project/pyactions-core/
:alt: Python

.. |pypi| image:: https://img.shields.io/pypi/v/pyactions-core.svg?logo=python&logoColor=white
:target: https://pypi.org/project/pyactions-core
:alt: PyPI

.. |CI-CD| image:: https://github.com/ansys/actions/actions/workflows/ci.yml/badge.svg
:target: https://github.com/ansys/actions/actions/workflows/ci.yml
:alt: CI-CD

.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat
:target: https://github.com/psf/black
:alt: Black


A demo library for testing Ansys actions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ build-backend = "flit_core.buildapi"
[project]
# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
name = "ansys-actions-core"
version = "4.0.dev0"
description = "A demo library for testing pyansys actions"
version = "4.0.19"
description = "A demo library for testing Ansys actions"
readme = "README.rst"
requires-python = ">=3.7"
license = {file = "LICENSE"}
authors = [
{name = "ANSYS, Inc.", email = "pyansys.support@ansys.com"},
{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"},
]
maintainers = [
{name = "PyAnsys developers", email = "pyansys.maintainers@ansys.com"},
{name = "PyAnsys developers", email = "pyansys.core@ansys.com"},
]

classifiers = [
Expand All @@ -31,4 +31,5 @@ dependencies = [
name = "ansys.actions.core"

[project.urls]
Source = "https://github.com/pyansys/actions"
Source = "https://github.com/ansys/actions"
Documentation = "https://actions.docs.ansys.com"
34 changes: 0 additions & 34 deletions .ci/pyansys-actions/README.rst

This file was deleted.

4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ updates:
directory: "/requirements"
schedule:
interval: "daily"
commit-message:
prefix: "build"
labels:
- "maintenance"
- "dependencies"
Expand All @@ -12,5 +14,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "build"
labels:
- "maintenance"
54 changes: 33 additions & 21 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GitHub CI
name: CI
on:
pull_request:
workflow_dispatch:
Expand All @@ -10,8 +10,8 @@ on:

env:
MAIN_PYTHON_VERSION: '3.10'
DOCUMENTATION_CNAME: 'actions.docs.pyansys.com'
test-library-name: 'pyansys-actions'
DOCUMENTATION_CNAME: 'ansys.github.io/actions'
test-library-name: 'ansys-actions'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -66,45 +66,57 @@ jobs:
labels: bug

- name: Suggest to add labels
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v3
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Please add one of the following labels to add this contribution to the Release Notes :point_down:
- [bug](https://github.com/pyansys/actions/pulls?q=label%3Abug+)
- [documentation](https://github.com/pyansys/actions/pulls?q=label%3Adocumentation+)
- [enhancement](https://github.com/pyansys/actions/pulls?q=label%3Aenhancement+)
- [good first issue](https://github.com/pyansys/actions/pulls?q=label%3Agood+first+issue)
- [maintenance](https://github.com/pyansys/actions/pulls?q=label%3Amaintenance+)
- [release](https://github.com/pyansys/actions/pulls?q=label%3Arelease+)
- [bug](https://github.com/ansys/actions/pulls?q=label%3Abug+)
- [documentation](https://github.com/ansys/actions/pulls?q=label%3Adocumentation+)
- [enhancement](https://github.com/ansys/actions/pulls?q=label%3Aenhancement+)
- [good first issue](https://github.com/ansys/actions/pulls?q=label%3Agood+first+issue)
- [maintenance](https://github.com/ansys/actions/pulls?q=label%3Amaintenance+)
- [release](https://github.com/ansys/actions/pulls?q=label%3Arelease+)
commit-and-branch-style:
name: "Commit and branch style"
runs-on: ubuntu-latest
needs: labeler
steps:

- uses: ansys/actions/commit-style@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: ansys/actions/branch-name-style@main

code-style:
name: "Code style"
runs-on: ubuntu-latest
needs: labeler
needs: commit-and-branch-style
steps:
- name: "Run code style checks"
uses: pyansys/actions/code-style@main
uses: ansys/actions/code-style@main
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false

- name: "Verify private actions are not pointing to the 'main' branch"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
run: |
if $(grep -q --exclude-dir={.git,.github,doc} "pyansys\/actions\/.*\@main" -r .); then
if $(grep -q --exclude-dir={.git,.github,doc} "ansys\/actions\/.*\@main" -r .); then
echo -e "\033[1;91m[ERROR]: Found private actions pointing to the 'main' branch.\033[0m"
grep -q --exclude-dir={.git,.github,doc} "pyansys\/actions\/.*\@main" -r .
grep -q --exclude-dir={.git,.github,doc} "ansys\/actions\/.*\@main" -r .
fi
doc-style:
name: "Doc style"
runs-on: ubuntu-latest
needs: labeler
needs: commit-and-branch-style
steps:
- name: "Run documentation style checks"
uses: pyansys/actions/doc-style@main
uses: ansys/actions/doc-style@main
with:
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -114,7 +126,7 @@ jobs:
needs: doc-style
steps:
- name: "Build documentation"
uses: pyansys/actions/doc-build@main
uses: ansys/actions/doc-build@main
with:
skip-install: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -130,7 +142,7 @@ jobs:
uses: actions/checkout@v3

- name: "Set up Python"
uses: pyansys/actions/_setup-python@main
uses: ansys/actions/_setup-python@main
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-cache: false
Expand All @@ -157,7 +169,7 @@ jobs:
retention-days: 7

- name: "Release to the test PyPI repository"
uses: pyansys/actions/release-pypi-test@main
uses: ansys/actions/release-pypi-test@main
with:
library-name: ${{ env.test-library-name }}
twine-username: "__token__"
Expand All @@ -169,7 +181,7 @@ jobs:
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags')
needs: [doc-build, tests]
steps:
- uses: pyansys/actions/doc-deploy-dev@main
- uses: ansys/actions/doc-deploy-dev@main
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -222,7 +234,7 @@ jobs:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: release
steps:
- uses: pyansys/actions/doc-deploy-stable@v4
- uses: ansys/actions/doc-deploy-stable@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 11 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.3.0
hooks:
- id: black

Expand All @@ -18,7 +18,16 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: requirements-txt-fixer
- id: trailing-whitespace
- id: debug-statements

# Validate our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.22.0
hooks:
- id: check-github-workflows
19 changes: 12 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
.. readme_common_begins
PyAnsys Actions
===============
|pyansys| |MIT|
Ansys actions
=============
|ansys| |CI-CD| |MIT|

.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
:target: https://docs.pyansys.com/
.. |ansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?labelColor=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
:target: https://actions.docs.ansys.com/
:alt: PyAnsys

.. |CI-CD| image:: https://github.com/ansys/actions/actions/workflows/ci.yml/badge.svg
:target: https://github.com/ansys/actions/actions/workflows/ci.yml
:alt: CI-CD

.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT

A repository containing a collection of `GitHub Workflows
<https://docs.github.com/en/actions/using-workflows/about-workflows>`_ to be
reused by projects in the PyAnsys ecosystem.
reused by projects in the Ansys ecosystem.

.. readme_common_ends
For more information on available actions and how to use them, see `actions.docs.pyansys.com <https://actions.docs.pyansys.com>`_ .
For more information on available actions and how to use them, see
`actions.docs.ansys.com <https://actions.docs.ansys.com>`_ .
4 changes: 2 additions & 2 deletions _logging/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: >
to quickly identify those in the GitHub actions logs.
inputs:

# Required inputs

level:
Expand All @@ -27,7 +27,7 @@ inputs:
runs:
using: "composite"
steps:

- name: "Report error message"
shell: bash
if: ${{ inputs.level == 'ERROR' }}
Expand Down
4 changes: 2 additions & 2 deletions _release-pypi/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ inputs:
runs:
using: "composite"
steps:

- name: "Set up Python"
uses: pyansys/actions/_setup-python@v4
uses: ansys/actions/_setup-python@v4
with:
python-version: ${{ inputs.python-version }}
use-cache: false
Expand Down
2 changes: 1 addition & 1 deletion _setup-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
runs:
using: "composite"
steps:

- name: "Set up Python using cache"
uses: actions/setup-python@v4
if: inputs.use-cache == 'true'
Expand Down
6 changes: 3 additions & 3 deletions build-ci-wheels/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |
version. The action uses the `cibuildwheel
<https://github.com/pypa/cibuildwheel>`_ behind the scenes.
.. note::
.. note::
This actions should only be used by libraries including source code that
needs to be compiled.
Expand Down Expand Up @@ -47,7 +47,7 @@ inputs:
type: string

requires-pypy:
description: >
description: >
Whether to generate wheels for wheel files for `PyPy
<https://www.pypy.org/>`_ in addition to the wheel files for CPython.
Default value is ``false``.
Expand All @@ -61,7 +61,7 @@ runs:

- name: "Install Git and clone project"
uses: actions/checkout@v3

- name: "Set up QEMU"
if: ${{ inputs.cibw-archs == 'aarch64' }}
uses: docker/setup-qemu-action@v2
Expand Down
8 changes: 4 additions & 4 deletions build-library/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description: |
.. note::
Use this action instead of the `build-ci-wheels
<https://actions.docs.pyansys.com/stable/doc-actions/index.html#build-ci-wheels-action>`_
<https://actions.docs.ansys.com/stable/doc-actions/index.html#build-ci-wheels-action>`_
if your library is a pure Python project with no source code to be compiled.
inputs:
Expand Down Expand Up @@ -46,12 +46,12 @@ inputs:
runs:
using: "composite"
steps:

- name: "Install Git and clone project"
uses: actions/checkout@v3

- name: "Set up Python"
uses: pyansys/actions/_setup-python@v4
uses: ansys/actions/_setup-python@v4
with:
python-version: ${{ inputs.python-version }}
use-cache: ${{ inputs.use-python-cache }}
Expand Down
Loading

0 comments on commit 3927545

Please sign in to comment.