1313 PACKAGE_NAME : ' ansys-geometry-core'
1414 PACKAGE_NAMESPACE : ' ansys.geometry.core'
1515 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
1718 ANSRV_GEO_PORT : 700
1819 ANSRV_GEO_LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
1920 GEO_CONT_NAME : ans_geo
20- RESET_IMAGE_CACHE : 6
21+ RESET_IMAGE_CACHE : 0
2122 IS_WORKFLOW_RUNNING : True
2223
2324concurrency :
5152 strategy :
5253 fail-fast : false
5354 matrix :
54- os : [ubuntu-latest, windows-latest]
55+ os : [ubuntu-latest, windows-latest, macos-latest ]
5556 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
5762 steps :
5863 - name : Build wheelhouse and perform smoke test
5964 uses : pyansys/actions/build-wheelhouse@v4
@@ -63,31 +68,12 @@ jobs:
6368 operating-system : ${{ matrix.os }}
6469 python-version : ${{ matrix.python-version }}
6570
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-
8571# =================================================================================================
8672# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
8773# =================================================================================================
8874
89- testing :
90- name : Testing and coverage
75+ testing-windows :
76+ name : Testing and coverage (Windows)
9177 needs : [smoke-tests]
9278 runs-on : [self-hosted, pygeometry]
9379
@@ -122,39 +108,50 @@ jobs:
122108 password : ${{ secrets.GITHUB_TOKEN }}
123109
124110 - 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
126124
127125 - name : Start Geometry service and verify start
128126 run : |
129127 .\.venv\Scripts\Activate.ps1
130128 $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
132130 python -c "from ansys.geometry.core.connection.validate import validate; validate()"
133131
134- - uses : actions/cache@v3
132+ - name : Restore images cache
133+ uses : actions/cache@v3
135134 with :
136135 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 }}
139138
140139 - 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
143140 run : |
144141 .\.venv\Scripts\Activate.ps1
145142 pytest -v
146143
147144 - name : Upload integration test logs
148145 uses : actions/upload-artifact@v3
149146 with :
150- name : integration-test-logs
147+ name : integration-test-logs-${{ runner.os }}
151148 path : tests/integration/logs
152149 retention-days : 7
153150
154151 - name : Upload PyVista generated images (cache and results)
155152 uses : actions/upload-artifact@v3
156153 with :
157- name : pytest-pyvista-images
154+ name : pytest-pyvista-images-${{ runner.os }}
158155 path : tests/integration/image_cache
159156 retention-days : 7
160157
@@ -210,13 +207,25 @@ jobs:
210207 password : ${{ secrets.GITHUB_TOKEN }}
211208
212209 - 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
214223
215224 - name : Start Geometry service and verify start
216225 run : |
217226 .\.venv\Scripts\Activate.ps1
218227 $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
220229 python -c "from ansys.geometry.core.connection.validate import validate; validate()"
221230
222231 - name : Build the documentation (HTML)
@@ -256,9 +265,68 @@ jobs:
256265# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
257266# =================================================================================================
258267
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+
259327 package :
260328 name : Package library
261- needs : [testing, docs]
329+ needs : [testing-windows , docs]
262330 runs-on : ubuntu-latest
263331 steps :
264332 - name : Build library source and wheel artifacts
@@ -270,7 +338,7 @@ jobs:
270338 release :
271339 name : Release project
272340 if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
273- needs : [package, macos-build ]
341+ needs : [package]
274342 runs-on : ubuntu-latest
275343 steps :
276344 - name : Release to the private PyPI repository
0 commit comments