1
- # check spelling, codestyle
2
1
name : GitHub CI
3
2
4
3
# run only on main branch. This avoids duplicated actions on PRs
56
55
run : |
57
56
pip install -U pip
58
57
pip install 'poetry!=1.7.0'
59
- poetry install --with dev,test
58
+ poetry install --with dev,test --all-extras
60
59
61
60
- name : Build API package from custom branch
62
61
if : " ${{ env.API_BRANCH != '' }}"
83
82
name : " Documentation style"
84
83
runs-on : ubuntu-latest
85
84
steps :
86
- - uses : ansys/actions/doc-style@v7
85
+ - uses : ansys/actions/doc-style@v8
87
86
with :
88
87
token : ${{ secrets.GITHUB_TOKEN }}
89
88
@@ -93,27 +92,161 @@ jobs:
93
92
strategy :
94
93
matrix :
95
94
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']
97
96
should-release :
98
97
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
99
98
exclude :
100
99
- should-release : false
101
100
os : macos-latest
102
101
steps :
103
102
- name : " Build wheelhouse and perform smoke test"
104
- uses : ansys/actions/build-wheelhouse@v7
103
+ uses : ansys/actions/build-wheelhouse@v8
105
104
with :
106
105
library-name : ${{ env.PACKAGE_NAME }}
107
106
operating-system : ${{ matrix.os }}
108
107
python-version : ${{ matrix.python-version }}
109
108
109
+ check-vulnerabilities :
110
+ name : " Check library vulnerabilities"
111
+ runs-on : ubuntu-latest
112
+ steps :
113
+ - uses : ansys/actions/check-vulnerabilities@v8.1
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
+
110
235
testing :
111
236
name : Testing
112
237
runs-on : ubuntu-latest
113
238
timeout-minutes : 30
114
239
strategy :
115
240
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"
117
250
118
251
steps :
119
252
- uses : actions/checkout@v4
@@ -137,7 +270,7 @@ jobs:
137
270
run : |
138
271
pip install -U pip
139
272
pip install 'poetry!=1.7.0'
140
- poetry install --with test
273
+ poetry install --with test --extras plotting
141
274
142
275
- name : Build API package from custom branch
143
276
if : " ${{ env.API_BRANCH != '' }}"
@@ -170,31 +303,23 @@ jobs:
170
303
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
171
304
env :
172
305
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 }}
182
307
183
308
- 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
186
310
env :
187
311
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
188
312
with :
189
313
files : coverage.xml
314
+ flags : ' server-${{ matrix.server-version }},python-${{ matrix.python-version }}'
190
315
191
316
- name : Benchmarks
192
317
working-directory : tests/benchmarks
193
318
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' }}
195
320
env :
196
321
LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
197
- IMAGE_NAME : ${{ env.DOCKER_IMAGE_NAME }}
322
+ IMAGE_NAME : ghcr.io/ansys/acp: ${{ matrix.server-version }}
198
323
199
324
- name : Store benchmark result
200
325
uses : benchmark-action/github-action-benchmark@v1
@@ -205,7 +330,7 @@ jobs:
205
330
benchmark-data-dir-path : benchmarks
206
331
auto-push : true
207
332
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'
209
334
210
335
doctest :
211
336
name : Test documentation snippets
@@ -232,7 +357,7 @@ jobs:
232
357
run : |
233
358
pip install -U pip
234
359
pip install 'poetry!=1.7.0'
235
- poetry install --with test,dev
360
+ poetry install --with test,dev --all-extras
236
361
237
362
- name : Build API package from custom branch
238
363
if : " ${{ env.API_BRANCH != '' }}"
@@ -268,7 +393,7 @@ jobs:
268
393
run : >
269
394
poetry run
270
395
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 }}
272
397
--image_name_filetransfer=ghcr.io/ansys/tools-filetransfer:latest
273
398
--license_server=1055@$LICENSE_SERVER
274
399
--keep_volume=False
@@ -328,7 +453,7 @@ jobs:
328
453
run : |
329
454
pip install -U pip
330
455
pip install 'poetry!=1.7.0'
331
- poetry install --with dev
456
+ poetry install --with dev --all-extras
332
457
333
458
- name : Build API package from custom branch
334
459
if : " ${{ env.API_BRANCH != '' }}"
@@ -351,7 +476,7 @@ jobs:
351
476
run : >
352
477
poetry run
353
478
ansys-launcher configure ACP docker_compose
354
- --image_name_pyacp =${{ env.DOCKER_IMAGE_NAME }}
479
+ --image_name_acp =${{ env.DOCKER_IMAGE_NAME }}
355
480
--image_name_filetransfer=ghcr.io/ansys/tools-filetransfer:latest
356
481
--license_server=1055@$LICENSE_SERVER
357
482
--keep_volume=False
@@ -421,11 +546,11 @@ jobs:
421
546
build :
422
547
name : Build library
423
548
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
425
550
timeout-minutes : 30
426
551
steps :
427
552
- name : Build library source and wheel artifacts
428
- uses : ansys/actions/build-library@v7
553
+ uses : ansys/actions/build-library@v8
429
554
with :
430
555
library-name : ${{ env.PACKAGE_NAME }}
431
556
python-version : ${{ env.MAIN_PYTHON_VERSION }}
@@ -437,14 +562,14 @@ jobs:
437
562
runs-on : ubuntu-latest
438
563
steps :
439
564
- name : Release to the public PyPI repository
440
- uses : ansys/actions/release-pypi-public@v7
565
+ uses : ansys/actions/release-pypi-public@v8
441
566
with :
442
567
library-name : ${{ env.PACKAGE_NAME }}
443
568
twine-username : " __token__"
444
569
twine-token : ${{ secrets.PYPI_TOKEN }}
445
570
446
571
- name : Release to GitHub
447
- uses : ansys/actions/release-github@v7
572
+ uses : ansys/actions/release-github@v8
448
573
with :
449
574
library-name : ${{ env.PACKAGE_NAME }}
450
575
@@ -455,11 +580,13 @@ jobs:
455
580
needs : [build]
456
581
steps :
457
582
- name : Deploy the latest documentation
458
- uses : ansys/actions/doc-deploy-dev@v7
583
+ uses : ansys/actions/doc-deploy-dev@v8
459
584
with :
460
585
cname : ${{ env.DOCUMENTATION_CNAME }}
461
- token : ${{ secrets.GITHUB_TOKEN }}
586
+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
462
587
force-orphan : false
588
+ bot-user : ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
589
+ bot-email : ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
463
590
464
591
upload_docs_release :
465
592
name : Upload release documentation
@@ -468,7 +595,9 @@ jobs:
468
595
needs : [release]
469
596
steps :
470
597
- name : Deploy the stable documentation
471
- uses : ansys/actions/doc-deploy-stable@v7
598
+ uses : ansys/actions/doc-deploy-stable@v8
472
599
with :
473
600
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