1+ ---
12name : GitHub CI
23
34on :
45 pull_request :
56 workflow_dispatch :
67 push :
78 tags :
8- - " * "
9+ - ' * '
910 branches :
10- - main
11+ - main
1112
1213env :
13- PACKAGE_NAME : ansys-tools-common
14- MAIN_PYTHON_VERSION : 3.13
15- DOCUMENTATION_CNAME : tools.docs.pyansys.com
14+ PACKAGE_NAME : ansys-tools-common
15+ MAIN_PYTHON_VERSION : 3.13
16+ DOCUMENTATION_CNAME : tools.docs.pyansys.com
1617
1718jobs :
1819
19- update-changelog :
20- name : " Update CHANGELOG (on release)"
21- if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
22- runs-on : ubuntu-latest
23- permissions :
24- contents : write
25- pull-requests : write
26- steps :
27- - uses : ansys/actions/doc-deploy-changelog@v10
28- with :
29- token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
30- bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
31- bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
32-
33- # TODO uncomment after the first public release
34- # check-vulnerabilities:
35- # name: "Check library vulnerabilities"
36- # runs-on: ubuntu-latest
37- # steps:
38- # - uses: ansys/actions/[email protected] 39- # with:
40- # python-version: ${{ env.MAIN_PYTHON_VERSION }}
41- # token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
42- # python-package-name: ${{ env.PACKAGE_NAME }}
43- # dev-mode: ${{ github.ref != 'refs/heads/main' }}
44-
45- style :
46- name : Code style
47- runs-on : ubuntu-latest
48- steps :
49- - name : PyAnsys code style checks
50- uses : ansys/actions/code-style@v10
51- with :
52- python-version : ${{ env.MAIN_PYTHON_VERSION }}
53- smoke-tests :
54- name : Build and Smoke tests
55- runs-on : ${{ matrix.os }}
56- strategy :
57- fail-fast : false
58- matrix :
59- os : [ubuntu-latest, windows-latest, macos-latest]
60- python-version : ['3.10', '3.11', '3.12']
61- steps :
62- - name : Build wheelhouse and perform smoke test
63- uses : ansys/actions/build-wheelhouse@v10
64- with :
65- library-name : ${{ env.PACKAGE_NAME }}
66- operating-system : ${{ matrix.os }}
67- python-version : ${{ matrix.python-version }}
68- whitelist-license-check : " termcolor" # Has MIT license, but it's not recognized
69-
70- tests :
71- name : Testing
72- runs-on : ubuntu-latest
73- needs : [smoke-tests]
74- env :
75- ANSYS_LOCAL : false
76- ON_UBUNTU : true
77-
78- steps :
79- - name : Checkout repository
80- uses : actions/checkout@v3
81- - name : Set up Python
82- uses : actions/setup-python@v4
83- with :
84- python-version : ${{ env.MAIN_PYTHON_VERSION }}
85- cache : ' pip'
86-
87- - name : Install uv and create venv
88- run : |
89- python -m pip install --upgrade pip
90- pip install uv
91- - name : Install project dependencies
92- run : |
93- uv sync --extra tests
94- - name : Run tests
95- run : |
96- uv sync --extra tests --no-dev
97- uv pip install tests/launcher/pkg_with_entrypoint
98- uv run pytest
99-
100- # - uses: codecov/codecov-action@v5
101- # name: 'Upload coverage to CodeCov'
102- # with:
103- # token: ${{ secrets.CODECOV_TOKEN }}
104-
105- docs-style :
106- name : Documentation Style Check
107- runs-on : ubuntu-latest
108- steps :
109- - name : PyAnsys documentation style checks
110- uses : ansys/actions/doc-style@v10
111- with :
112- token : ${{ secrets.GITHUB_TOKEN }}
113-
114- doc-build :
115- name : Build documentation
116- needs : [docs-style]
117- runs-on : ubuntu-latest
118- steps :
119- - name : Build documentation
120- uses : ansys/actions/doc-build@v10
121- with :
122- python-version : ${{ env.MAIN_PYTHON_VERSION }}
123- check-links : false # Delete after first release
124-
125- package :
126- name : Package library
127- runs-on : ubuntu-latest
128- needs : [tests, doc-build]
129- steps :
130- - name : Build library source and wheel artifacts
131- uses : ansys/actions/build-library@v10
132- with :
133- library-name : ${{ env.PACKAGE_NAME }}
134- python-version : ${{ env.MAIN_PYTHON_VERSION }}
135-
136- release :
137- name : Release project
138- if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
139- needs : [package]
140- runs-on : ubuntu-latest
141- environment : release
142- permissions :
143- id-token : write
144- contents : write
145- steps :
146- - name : " Download the library artifacts from build-library step"
147- uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
148- with :
149- name : ${{ env.PACKAGE_NAME }}-artifacts
150- path : ${{ env.PACKAGE_NAME }}-artifacts
151-
152- # TODO uncomment after the first public release
153- # - name: "Upload artifacts to PyPI using trusted publisher"
154- # uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
155- # with:
156- # repository-url: "https://upload.pypi.org/legacy/"
157- # print-hash: true
158- # packages-dir: ${{ env.PACKAGE_NAME }}-artifacts
159- # skip-existing: false
160-
161- - name : " Release to the private PyPI repository"
162- uses : ansys/actions/release-pypi-private@v9
163- with :
164- library-name : " ansys-tools-common"
165- twine-username : " __token__"
166- twine-token : ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
167-
168- - name : Release to GitHub
169- uses : ansys/actions/release-github@v10
170- with :
171- token : ${{ secrets.GITHUB_TOKEN }}
172- library-name : ${{ env.PACKAGE_NAME }}
173-
174- upload_docs_release :
175- name : Upload release documentation
176- if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
177- runs-on : ubuntu-latest
178- needs : [release]
179- steps :
180- - name : Deploy the stable documentation
181- uses : ansys/actions/doc-deploy-stable@v10
182- with :
183- cname : ${{ env.DOCUMENTATION_CNAME }}
184- token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
185- bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
186- bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
20+ changelog-fragment :
21+ name : Create changelog fragment
22+ runs-on : ubuntu-latest
23+ permissions :
24+ contents : write
25+ pull-requests : write
26+ steps :
27+ - uses : ansys/actions/doc-changelog@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
28+ with :
29+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
30+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
31+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
32+
33+ code-style :
34+ name : Code style
35+ runs-on : ubuntu-latest
36+ steps :
37+ - uses : ansys/actions/code-style@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
38+ with :
39+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
40+
41+ doc-style :
42+ name : Doc style
43+ runs-on : ubuntu-latest
44+ steps :
45+ - uses : ansys/actions/doc-style@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
46+ with :
47+ token : ${{ secrets.GITHUB_TOKEN }}
48+
49+ actions-style :
50+ name : Actions style
51+ runs-on : ubuntu-latest
52+ steps :
53+ - uses : ansys/actions/check-actions-security@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
54+ with :
55+ generate-summary : true
56+ token : ${{ secrets.GITHUB_TOKEN }}
57+ auditing-level : high
58+
59+ wheelhouse :
60+ name : Wheelhouse / ${{ matrix.os }} /
61+ runs-on : ${{ matrix.os }}
62+ needs : code-style
63+ strategy :
64+ fail-fast : false
65+ matrix :
66+ os : [ubuntu-latest, windows-latest, macos-latest]
67+ python : ['3.10', '3.11', '3.12']
68+ steps :
69+ - uses : ansys/actions/build-wheelhouse@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
70+ with :
71+ library-name : ${{ env.PACKAGE_NAME }}
72+ operating-system : ${{ matrix.os }}
73+ python-version : ${{ matrix.python }}
74+ whitelist-license-check : termcolor # Has MIT license, but it's not recognized
75+
76+ tests :
77+ name : Testing
78+ runs-on : ubuntu-latest
79+ needs : wheelhouse
80+ strategy :
81+ fail-fast : false
82+ matrix :
83+ os : [ubuntu-latest, windows-latest, macos-latest]
84+ python : ['3.10', '3.11', '3.12']
85+ env :
86+ ANSYS_LOCAL : false
87+ ON_UBUNTU : true
88+ steps :
89+ - uses : ansys/actions/tests-pytest@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
90+ with :
91+ group-dependencies : tests
92+ # uv pip install tests/launcher/pkg_with_entrypoint
93+
94+ doc-build :
95+ name : Build documentation
96+ needs : doc-style
97+ runs-on : ubuntu-latest
98+ steps :
99+ - uses : ansys/actions/doc-build@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
100+ with :
101+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
102+ check-links : false
103+ group-dependencies : doc
104+
105+ build-library :
106+ name : Build library
107+ runs-on : ubuntu-latest
108+ needs : [doc-build, tests]
109+ steps :
110+ - uses : ansys/actions/build-library@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
111+ with :
112+ library-name : ${{ env.PACKAGE_NAME }}
113+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
114+
115+ release :
116+ name : Release project
117+ if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
118+ needs : build-library
119+ runs-on : ubuntu-latest
120+ environment : release
121+ permissions :
122+ id-token : write
123+ contents : write
124+ steps :
125+ - name : Download artifacts
126+ uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
127+ with :
128+ name : ${{ env.PACKAGE_NAME }}-artifacts
129+ path : ${{ env.PACKAGE_NAME }}-artifacts
130+
131+ - name : Release to the public PyPI
132+ uses : pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
133+ with :
134+ repository-url : https://upload.pypi.org/legacy/
135+ print-hash : true
136+ packages-dir : ${{ env.PACKAGE_NAME }}-artifacts
137+ skip-existing : false
138+
139+ - name : Release to GitHub
140+ uses : ansys/actions/release-github@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
141+ with :
142+ token : ${{ secrets.GITHUB_TOKEN }}
143+ library-name : ${{ env.PACKAGE_NAME }}
144+
145+ doc-deploy-stable :
146+ name : Deploy stable docs
147+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
148+ runs-on : ubuntu-latest
149+ needs : release
150+ steps :
151+ - uses : ansys/actions/doc-deploy-stable@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
152+ with :
153+ cname : ${{ env.DOCUMENTATION_CNAME }}
154+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
155+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
156+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
157+
158+ deploy-changelog :
159+ name : Deploy changelog
160+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
161+ runs-on : ubuntu-latest
162+ needs : doc-deploy-stable
163+ permissions :
164+ contents : write
165+ pull-requests : write
166+ steps :
167+ - uses : ansys/actions/doc-deploy-changelog@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
168+ with :
169+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
170+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
171+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
172+
173+
0 commit comments