13
13
PACKAGE_NAME : ' ansys-geometry-core'
14
14
PACKAGE_NAMESPACE : ' ansys.geometry.core'
15
15
DOCUMENTATION_CNAME : ' geometry.docs.pyansys.com'
16
- ANSRV_GEO_IMAGE : ghcr.io/pyansys/geometry:windows-latest
16
+ ANSRV_GEO_IMAGE_WINDOWS_TAG : ghcr.io/pyansys/geometry:windows-latest
17
+ ANSRV_GEO_IMAGE_LINUX_TAG : ghcr.io/pyansys/geometry:linux-latest
17
18
ANSRV_GEO_PORT : 700
18
19
ANSRV_GEO_LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
19
20
GEO_CONT_NAME : ans_geo
20
- RESET_IMAGE_CACHE : 6
21
+ RESET_IMAGE_CACHE : 0
21
22
IS_WORKFLOW_RUNNING : True
22
23
23
24
concurrency :
51
52
strategy :
52
53
fail-fast : false
53
54
matrix :
54
- os : [ubuntu-latest, windows-latest]
55
+ os : [ubuntu-latest, windows-latest, macos-latest ]
55
56
python-version : ['3.7', '3.8', '3.9', '3.10', '3.11']
56
-
57
+ should-release :
58
+ - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
59
+ exclude :
60
+ - should-release : false
61
+ os : macos-latest
57
62
steps :
58
63
- name : Build wheelhouse and perform smoke test
59
64
uses : pyansys/actions/build-wheelhouse@v4
@@ -63,31 +68,12 @@ jobs:
63
68
operating-system : ${{ matrix.os }}
64
69
python-version : ${{ matrix.python-version }}
65
70
66
- macos-build :
67
- name : Build and Smoke tests (macOS)
68
- if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
69
- runs-on : macos-latest
70
- needs : [style]
71
- strategy :
72
- fail-fast : false
73
- matrix :
74
- python-version : ['3.7', '3.8', '3.9', '3.10', '3.11']
75
-
76
- steps :
77
- - name : Build wheelhouse and perform smoke test
78
- uses : pyansys/actions/build-wheelhouse@v4
79
- with :
80
- library-name : ${{ env.PACKAGE_NAME }}
81
- library-namespace : ${{ env.PACKAGE_NAMESPACE }}
82
- operating-system : ${{ runner.os }}
83
- python-version : ${{ matrix.python-version }}
84
-
85
71
# =================================================================================================
86
72
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
87
73
# =================================================================================================
88
74
89
- testing :
90
- name : Testing and coverage
75
+ testing-windows :
76
+ name : Testing and coverage (Windows)
91
77
needs : [smoke-tests]
92
78
runs-on : [self-hosted, pygeometry]
93
79
@@ -122,39 +108,50 @@ jobs:
122
108
password : ${{ secrets.GITHUB_TOKEN }}
123
109
124
110
- name : Download Geometry service container (if needed)
125
- run : docker pull $env:ANSRV_GEO_IMAGE
111
+ run : docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
112
+
113
+ - name : Check runner type
114
+ if : runner.name == 'pygeometry-ci-1'
115
+ env :
116
+ INTERNAL_DOCKER_EXTRA_ENVS : ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
117
+ run : |
118
+ $env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
119
+
120
+ - name : Check runner type (not needed)
121
+ if : runner.name != 'pygeometry-ci-1'
122
+ run : |
123
+ echo "" | Out-File -FilePath env.list -Encoding UTF8
126
124
127
125
- name : Start Geometry service and verify start
128
126
run : |
129
127
.\.venv\Scripts\Activate.ps1
130
128
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
131
- docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE
129
+ docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list - p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
132
130
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
133
131
134
- - uses : actions/cache@v3
132
+ - name : Restore images cache
133
+ uses : actions/cache@v3
135
134
with :
136
135
path : .\tests\integration\image_cache
137
- key : pyvista-image-cache-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
138
- restore-keys : pyvista-image-cache-v-${{ env.RESET_IMAGE_CACHE }}
136
+ key : pyvista-image-cache-${{ runner.os }}- v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
137
+ restore-keys : pyvista-image-cache-${{ runner.os }}- v-${{ env.RESET_IMAGE_CACHE }}
139
138
140
139
- name : Testing
141
- # TODO : Once the container is available on Linux we should be able to run it as
142
- # a service, allowing to remove this stage
143
140
run : |
144
141
.\.venv\Scripts\Activate.ps1
145
142
pytest -v
146
143
147
144
- name : Upload integration test logs
148
145
uses : actions/upload-artifact@v3
149
146
with :
150
- name : integration-test-logs
147
+ name : integration-test-logs-${{ runner.os }}
151
148
path : tests/integration/logs
152
149
retention-days : 7
153
150
154
151
- name : Upload PyVista generated images (cache and results)
155
152
uses : actions/upload-artifact@v3
156
153
with :
157
- name : pytest-pyvista-images
154
+ name : pytest-pyvista-images-${{ runner.os }}
158
155
path : tests/integration/image_cache
159
156
retention-days : 7
160
157
@@ -210,13 +207,25 @@ jobs:
210
207
password : ${{ secrets.GITHUB_TOKEN }}
211
208
212
209
- name : Download Geometry service container (if needed)
213
- run : docker pull $env:ANSRV_GEO_IMAGE
210
+ run : docker pull $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
211
+
212
+ - name : Check runner type
213
+ if : runner.name == 'pygeometry-ci-1'
214
+ env :
215
+ INTERNAL_DOCKER_EXTRA_ENVS : ${{ secrets.INTERNAL_DOCKER_EXTRA_ENVS }}
216
+ run : |
217
+ $env:INTERNAL_DOCKER_EXTRA_ENVS | Out-File -FilePath env.list -Encoding UTF8
218
+
219
+ - name : Check runner type (not needed)
220
+ if : runner.name != 'pygeometry-ci-1'
221
+ run : |
222
+ echo "" | Out-File -FilePath env.list -Encoding UTF8
214
223
215
224
- name : Start Geometry service and verify start
216
225
run : |
217
226
.\.venv\Scripts\Activate.ps1
218
227
$env:ANSRV_GEO_PORT_MAP = $env:ANSRV_GEO_PORT + ":50051"
219
- docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER -p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE
228
+ docker run --detach --name $env:GEO_CONT_NAME -e LICENSE_SERVER=$env:ANSRV_GEO_LICENSE_SERVER --env-file .\env.list - p $env:ANSRV_GEO_PORT_MAP $env:ANSRV_GEO_IMAGE_WINDOWS_TAG
220
229
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
221
230
222
231
- name : Build the documentation (HTML)
@@ -256,9 +265,68 @@ jobs:
256
265
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
257
266
# =================================================================================================
258
267
268
+ testing-linux :
269
+ name : Testing and coverage (Linux)
270
+ needs : [smoke-tests]
271
+ runs-on : ubuntu-latest
272
+
273
+ steps :
274
+ - name : Login in Github Container registry
275
+ uses : docker/login-action@v2
276
+ with :
277
+ registry : ghcr.io
278
+ username : ${{ github.actor }}
279
+ password : ${{ secrets.GITHUB_TOKEN }}
280
+
281
+ - name : Pull and launch geometry service
282
+ run : |
283
+ docker pull ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }}
284
+ docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }}
285
+
286
+ - name : Checkout repository
287
+ uses : actions/checkout@v3
288
+
289
+ - name : Restore images cache
290
+ uses : actions/cache@v3
291
+ with :
292
+ path : tests/integration/image_cache
293
+ key : pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
294
+ restore-keys : pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
295
+
296
+ - name : Run pytest
297
+ uses : pyansys/actions/tests-pytest@v4
298
+ env :
299
+ ALLOW_PLOTTING : true
300
+ with :
301
+ python-version : ${{ env.MAIN_PYTHON_VERSION }}
302
+ pytest-extra-args : " --service-os=linux"
303
+ checkout : false
304
+ requires-xvfb : true
305
+
306
+ - name : Upload integration test logs
307
+ uses : actions/upload-artifact@v3
308
+ with :
309
+ name : integration-test-logs-${{ runner.os }}
310
+ path : tests/integration/logs
311
+ retention-days : 7
312
+
313
+ - name : Upload PyVista generated images (cache and results)
314
+ uses : actions/upload-artifact@v3
315
+ with :
316
+ name : pytest-pyvista-images-${{ runner.os }}
317
+ path : tests/integration/image_cache
318
+ retention-days : 7
319
+
320
+ - name : Stop the Geometry service
321
+ if : always()
322
+ run : |
323
+ docker stop ${{ env.GEO_CONT_NAME }}
324
+ docker logs ${{ env.GEO_CONT_NAME }}
325
+ docker rm ${{ env.GEO_CONT_NAME }}
326
+
259
327
package :
260
328
name : Package library
261
- needs : [testing, docs]
329
+ needs : [testing-windows , docs]
262
330
runs-on : ubuntu-latest
263
331
steps :
264
332
- name : Build library source and wheel artifacts
@@ -270,7 +338,7 @@ jobs:
270
338
release :
271
339
name : Release project
272
340
if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
273
- needs : [package, macos-build ]
341
+ needs : [package]
274
342
runs-on : ubuntu-latest
275
343
steps :
276
344
- name : Release to the private PyPI repository
0 commit comments