1- # check spelling, codestyle
21name : GitHub CI
32
43# run only on main branch. This avoids duplicated actions on PRs
5655 run : |
5756 pip install -U pip
5857 pip install 'poetry!=1.7.0'
59- poetry install --with dev,test
58+ poetry install --with dev,test --all-extras
6059
6160 - name : Build API package from custom branch
6261 if : " ${{ env.API_BRANCH != '' }}"
8382 name : " Documentation style"
8483 runs-on : ubuntu-latest
8584 steps :
86- - uses : ansys/actions/doc-style@v7
85+ - uses : ansys/actions/doc-style@v8
8786 with :
8887 token : ${{ secrets.GITHUB_TOKEN }}
8988
@@ -93,27 +92,161 @@ jobs:
9392 strategy :
9493 matrix :
9594 os : [ubuntu-latest, windows-latest, macos-latest]
96- python-version : ['3.9', '3. 10', '3.11', '3.12']
95+ python-version : ['3.10', '3.11', '3.12']
9796 should-release :
9897 - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
9998 exclude :
10099 - should-release : false
101100 os : macos-latest
102101 steps :
103102 - name : " Build wheelhouse and perform smoke test"
104- uses : ansys/actions/build-wheelhouse@v7
103+ uses : ansys/actions/build-wheelhouse@v8
105104 with :
106105 library-name : ${{ env.PACKAGE_NAME }}
107106 operating-system : ${{ matrix.os }}
108107 python-version : ${{ matrix.python-version }}
109108
109+ check-vulnerabilities :
110+ name : " Check library vulnerabilities"
111+ runs-on : ubuntu-latest
112+ steps :
113+ -
uses :
ansys/actions/[email protected] 114+ with :
115+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
116+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
117+ python-package-name : ' ansys-acp-core'
118+ dev-mode : ${{ github.ref != 'refs/heads/main' }}
119+ extra-targets : " plotting"
120+
121+ testing-direct-launch :
122+ name : Testing with direct launch mode
123+ runs-on : ubuntu-latest
124+ timeout-minutes : 30
125+
126+ steps :
127+ - uses : actions/checkout@v4
128+ - name : Login in Github Container registry
129+ uses : docker/login-action@v3
130+ with :
131+ registry : ghcr.io
132+ username : ${{ github.actor }}
133+ password : ${{ secrets.GITHUB_TOKEN }}
134+ # Python version is determined by the base image
135+ - name : Build docker image
136+ run : docker build -t test_runner -f dockerfiles/DirectLaunchTest.Dockerfile .
137+ - name : Run tests
138+ run : |
139+ docker run \
140+ --mount type=bind,source="$(pwd)",target=/home/container/pyacp \
141+ -u $(id -u):$(id -g) \
142+ -e ANSYSLMD_LICENSE_FILE=$ANSYSLMD_LICENSE_FILE \
143+ test_runner
144+ env :
145+ ANSYSLMD_LICENSE_FILE : " 1055@${{ secrets.LICENSE_SERVER }}"
146+ - name : " Upload coverage to Codecov"
147+ uses : codecov/codecov-action@v5
148+ env :
149+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
150+ with :
151+ files : coverage.xml
152+ flags : ' direct-launch,server-latest'
153+
154+ testing-minimum-deps :
155+ name : Testing with minimum dependencies
156+ runs-on : ubuntu-latest
157+ timeout-minutes : 30
158+ strategy :
159+ matrix :
160+ python-version : ["3.10", "3.11", "3.12"]
161+ server-version : ["latest"]
162+ steps :
163+ - uses : actions/checkout@v4
164+
165+ - name : Pip cache
166+ uses : actions/cache@v4
167+ with :
168+ path : ~/.cache/pip
169+ key : pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-testing-minimum-deps
170+ restore-keys : |
171+ pip-${{ runner.os }}-${{ matrix.python-version }}
172+
173+ - name : Setup Python
174+ uses : actions/setup-python@v5
175+ with :
176+ python-version : |
177+ 3.10
178+ ${{ matrix.python-version }}
179+
180+ - name : Install library, with only the 'main' group
181+ run : |
182+ pip install -U pip
183+ pip install 'poetry!=1.7.0'
184+ poetry install --only main
185+
186+ - name : Check that PyACP can be imported
187+ run : |
188+ poetry run python -c "import ansys.acp.core"
189+
190+ - name : Install the 'test' group
191+ run : |
192+ poetry install --with test
193+
194+ - name : Build API package from custom branch
195+ if : " ${{ env.API_BRANCH != '' }}"
196+ run : |
197+ python3.10 -m venv .api_builder_venv
198+ . .api_builder_venv/bin/activate
199+ python -m pip install --upgrade pip wheel
200+ mkdir .api_package
201+ python -m pip wheel --no-deps --wheel-dir .api_package git+https://github.com/ansys/ansys-api-acp.git@${{ env.API_BRANCH }}
202+
203+ - name : Install custom API branch package
204+ if : " ${{ env.API_BRANCH != '' }}"
205+ # The --no-deps flag is added since this may cause dependency conflicts with
206+ # other transitive dependencies. For example, when a newer version of protobuf
207+ # is installed.
208+ run : |
209+ poetry run pip install --no-deps --force-reinstall .api_package/*.whl
210+
211+ - name : Login in Github Container registry
212+ uses : docker/login-action@v3
213+ with :
214+ registry : ghcr.io
215+ username : ${{ github.actor }}
216+ password : ${{ secrets.GITHUB_TOKEN }}
217+
218+ - name : Unit testing
219+ working-directory : tests/unittests
220+ run : |
221+ docker pull $IMAGE_NAME
222+ poetry run pytest -v --license-server=1055@$LICENSE_SERVER --no-server-log-files --docker-image=$IMAGE_NAME --cov=ansys.acp.core --cov-report=term --cov-report=xml --cov-report=html -m "not plotting"
223+ env :
224+ LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
225+ IMAGE_NAME : ghcr.io/ansys/acp:${{ matrix.server-version }}
226+
227+ - name : " Upload coverage to Codecov"
228+ uses : codecov/codecov-action@v5
229+ env :
230+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
231+ with :
232+ files : coverage.xml
233+ flags : ' server-${{ matrix.server-version }},python-${{ matrix.python-version }},minimum-deps'
234+
110235 testing :
111236 name : Testing
112237 runs-on : ubuntu-latest
113238 timeout-minutes : 30
114239 strategy :
115240 matrix :
116- python-version : ["3.9", "3.10", "3.11", "3.12"]
241+ python-version : ["3.10", "3.11", "3.12"]
242+ server-version : ["latest"]
243+ include :
244+ - python-version : " 3.12"
245+ server-version : " 2024R2"
246+ - python-version : " 3.12"
247+ server-version : " 2025R1"
248+ - python-version : " 3.12"
249+ server-version : " 2025R2"
117250
118251 steps :
119252 - uses : actions/checkout@v4
@@ -137,7 +270,7 @@ jobs:
137270 run : |
138271 pip install -U pip
139272 pip install 'poetry!=1.7.0'
140- poetry install --with test
273+ poetry install --with test --extras plotting
141274
142275 - name : Build API package from custom branch
143276 if : " ${{ env.API_BRANCH != '' }}"
@@ -170,31 +303,23 @@ jobs:
170303 poetry run pytest -v --license-server=1055@$LICENSE_SERVER --no-server-log-files --docker-image=$IMAGE_NAME --cov=ansys.acp.core --cov-report=term --cov-report=xml --cov-report=html
171304 env :
172305 LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
173- IMAGE_NAME : " ghcr.io/ansys/acp${{ github.event.inputs.docker_image_suffix || ':latest' }}"
174-
175- - name : " Upload coverage report (HTML)"
176- uses : actions/upload-artifact@v4
177- if : matrix.python-version == env.MAIN_PYTHON_VERSION
178- with :
179- name : coverage-report-html
180- path : htmlcov
181- retention-days : 7
306+ IMAGE_NAME : ghcr.io/ansys/acp:${{ matrix.server-version }}
182307
183308 - name : " Upload coverage to Codecov"
184- uses : codecov/codecov-action@v4
185- if : matrix.python-version == env.MAIN_PYTHON_VERSION
309+ uses : codecov/codecov-action@v5
186310 env :
187311 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
188312 with :
189313 files : coverage.xml
314+ flags : ' server-${{ matrix.server-version }},python-${{ matrix.python-version }}'
190315
191316 - name : Benchmarks
192317 working-directory : tests/benchmarks
193318 run : |
194- poetry run pytest -v --license-server=1055@$LICENSE_SERVER --no-server-log-files --docker-image=$IMAGE_NAME --build-benchmark-image --benchmark-json benchmark_output.json --benchmark-group-by=fullname ${{ (matrix.python-version == '3.9' && github.ref == 'refs/heads/main ') && ' ' || '--validate-benchmarks-only' }}
319+ poetry run pytest -v --license-server=1055@$LICENSE_SERVER --no-server-log-files --docker-image=$IMAGE_NAME --build-benchmark-image --benchmark-json benchmark_output.json --benchmark-group-by=fullname ${{ (matrix.python-version == env.MAIN_PYTHON_VERSION && matrix.server-version == 'latest ') && ' ' || '--validate-benchmarks-only' }}
195320 env :
196321 LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
197- IMAGE_NAME : ${{ env.DOCKER_IMAGE_NAME }}
322+ IMAGE_NAME : ghcr.io/ansys/acp: ${{ matrix.server-version }}
198323
199324 - name : Store benchmark result
200325 uses : benchmark-action/github-action-benchmark@v1
@@ -205,7 +330,7 @@ jobs:
205330 benchmark-data-dir-path : benchmarks
206331 auto-push : true
207332 github-token : ${{ secrets.GITHUB_TOKEN }}
208- if : matrix.python-version == env.MAIN_PYTHON_VERSION && github.ref == 'refs/heads/main'
333+ if : matrix.python-version == env.MAIN_PYTHON_VERSION && matrix.server-version == 'latest' && github.ref == 'refs/heads/main'
209334
210335 doctest :
211336 name : Test documentation snippets
@@ -232,7 +357,7 @@ jobs:
232357 run : |
233358 pip install -U pip
234359 pip install 'poetry!=1.7.0'
235- poetry install --with test,dev
360+ poetry install --with test,dev --all-extras
236361
237362 - name : Build API package from custom branch
238363 if : " ${{ env.API_BRANCH != '' }}"
@@ -268,7 +393,7 @@ jobs:
268393 run : >
269394 poetry run
270395 ansys-launcher configure ACP docker_compose
271- --image_name_pyacp=ghcr.io/ansys/acp ${{ github.event.inputs.docker_image_suffix || ':latest' }}
396+ --image_name_acp= ${{ env.DOCKER_IMAGE_NAME }}
272397 --image_name_filetransfer=ghcr.io/ansys/tools-filetransfer:latest
273398 --license_server=1055@$LICENSE_SERVER
274399 --keep_volume=False
@@ -328,7 +453,7 @@ jobs:
328453 run : |
329454 pip install -U pip
330455 pip install 'poetry!=1.7.0'
331- poetry install --with dev
456+ poetry install --with dev --all-extras
332457
333458 - name : Build API package from custom branch
334459 if : " ${{ env.API_BRANCH != '' }}"
@@ -351,7 +476,7 @@ jobs:
351476 run : >
352477 poetry run
353478 ansys-launcher configure ACP docker_compose
354- --image_name_pyacp =${{ env.DOCKER_IMAGE_NAME }}
479+ --image_name_acp =${{ env.DOCKER_IMAGE_NAME }}
355480 --image_name_filetransfer=ghcr.io/ansys/tools-filetransfer:latest
356481 --license_server=1055@$LICENSE_SERVER
357482 --keep_volume=False
@@ -421,11 +546,11 @@ jobs:
421546 build :
422547 name : Build library
423548 runs-on : ubuntu-latest
424- needs : [code-style, testing, doc-style, docs, build-wheelhouse, doctest]
549+ needs : [code-style, testing, testing-minimum-deps, testing-direct-launch, doc-style, docs, build-wheelhouse, doctest] # TODO: add check-vulnerabilities once we know it works on main
425550 timeout-minutes : 30
426551 steps :
427552 - name : Build library source and wheel artifacts
428- uses : ansys/actions/build-library@v7
553+ uses : ansys/actions/build-library@v8
429554 with :
430555 library-name : ${{ env.PACKAGE_NAME }}
431556 python-version : ${{ env.MAIN_PYTHON_VERSION }}
@@ -437,14 +562,14 @@ jobs:
437562 runs-on : ubuntu-latest
438563 steps :
439564 - name : Release to the public PyPI repository
440- uses : ansys/actions/release-pypi-public@v7
565+ uses : ansys/actions/release-pypi-public@v8
441566 with :
442567 library-name : ${{ env.PACKAGE_NAME }}
443568 twine-username : " __token__"
444569 twine-token : ${{ secrets.PYPI_TOKEN }}
445570
446571 - name : Release to GitHub
447- uses : ansys/actions/release-github@v7
572+ uses : ansys/actions/release-github@v8
448573 with :
449574 library-name : ${{ env.PACKAGE_NAME }}
450575
@@ -455,11 +580,13 @@ jobs:
455580 needs : [build]
456581 steps :
457582 - name : Deploy the latest documentation
458- uses : ansys/actions/doc-deploy-dev@v7
583+ uses : ansys/actions/doc-deploy-dev@v8
459584 with :
460585 cname : ${{ env.DOCUMENTATION_CNAME }}
461- token : ${{ secrets.GITHUB_TOKEN }}
586+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
462587 force-orphan : false
588+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
589+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
463590
464591 upload_docs_release :
465592 name : Upload release documentation
@@ -468,7 +595,9 @@ jobs:
468595 needs : [release]
469596 steps :
470597 - name : Deploy the stable documentation
471- uses : ansys/actions/doc-deploy-stable@v7
598+ uses : ansys/actions/doc-deploy-stable@v8
472599 with :
473600 cname : ${{ env.DOCUMENTATION_CNAME }}
474- token : ${{ secrets.GITHUB_TOKEN }}
601+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
602+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
603+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
0 commit comments