17
17
ANSRV_GEO_PORT : 700
18
18
ANSRV_GEO_LICENSE_SERVER : ${{ secrets.LICENSE_SERVER }}
19
19
GEO_CONT_NAME : ans_geo
20
- RESET_IMAGE_CACHE : 3
20
+ RESET_IMAGE_CACHE : 6
21
21
IS_WORKFLOW_RUNNING : True
22
22
ARTIFACTORY_VERSION : v241
23
23
66
66
needs : [smoke-tests]
67
67
runs-on : [self-hosted, Windows, pygeometry]
68
68
continue-on-error : ${{ matrix.experimental }}
69
+ env :
70
+ SKIP_UNSTABLE : ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
69
71
strategy :
70
72
fail-fast : false
71
73
matrix :
@@ -76,58 +78,67 @@ jobs:
76
78
experimental : true
77
79
78
80
steps :
79
-
80
81
- uses : actions/checkout@v4
82
+ if : env.SKIP_UNSTABLE == 'false'
81
83
82
84
- name : Set up Python
85
+ if : env.SKIP_UNSTABLE == 'false'
83
86
uses : actions/setup-python@v4
84
87
with :
85
88
python-version : ' 3.9' # use python3.9, self-hosted has an issue with 3.10
86
89
87
90
- name : Set up headless display
91
+ if : env.SKIP_UNSTABLE == 'false'
88
92
uses : pyvista/setup-headless-display-action@v2
89
93
90
94
- name : Create Python venv
95
+ if : env.SKIP_UNSTABLE == 'false'
91
96
run : |
92
97
python -m venv .venv
93
98
.\.venv\Scripts\Activate.ps1
94
99
95
100
- name : Install packages for testing
101
+ if : env.SKIP_UNSTABLE == 'false'
96
102
run : |
97
103
.\.venv\Scripts\Activate.ps1
98
104
python -m pip install --upgrade pip
99
105
pip install --upgrade build wheel
100
106
pip install .[tests]
101
107
102
108
- name : Login to GitHub Container Registry
103
- uses : docker/login-action@v2
109
+ if : env.SKIP_UNSTABLE == 'false'
110
+ uses : docker/login-action@v3
104
111
with :
105
112
registry : ghcr.io
106
113
username : ${{ github.actor }}
107
114
password : ${{ secrets.GITHUB_TOKEN }}
108
115
109
116
- name : Download Geometry service container (if needed)
117
+ if : env.SKIP_UNSTABLE == 'false'
110
118
run : docker pull ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.docker-image }}
111
119
112
120
- name : Check location of self-hosted runner and define license server accordingly
113
- if : runner.name == 'pygeometry-ci-1' || runner.name == 'pygeometry-ci-2'
121
+ if : env.SKIP_UNSTABLE == 'false' && ( runner.name == 'pygeometry-ci-1' || runner.name == 'pygeometry-ci-2')
114
122
run :
115
123
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append
116
124
117
125
- name : Start Geometry service and verify start
126
+ if : env.SKIP_UNSTABLE == 'false'
118
127
run : |
119
128
.\.venv\Scripts\Activate.ps1
120
129
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 }}:${{ matrix.docker-image }}
121
130
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
122
131
123
132
- name : Restore images cache
133
+ if : env.SKIP_UNSTABLE == 'false'
124
134
uses : actions/cache@v3
125
135
with :
126
136
path : .\tests\integration\image_cache
127
137
key : pyvista-image-cache-${{ runner.name }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
128
138
restore-keys : pyvista-image-cache-${{ runner.name }}-v-${{ env.RESET_IMAGE_CACHE }}
129
139
130
140
- name : Testing
141
+ if : env.SKIP_UNSTABLE == 'false'
131
142
run : |
132
143
.\.venv\Scripts\Activate.ps1
133
144
pytest -v
@@ -159,15 +170,20 @@ jobs:
159
170
- name : Upload coverage to Codecov
160
171
uses : codecov/codecov-action@v3
161
172
if : matrix.docker-image == 'windows-latest'
173
+ env :
174
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
162
175
with :
163
176
files : .cov/xml
164
177
165
178
- name : Stop the Geometry service
166
179
if : always()
167
180
run : |
168
- docker stop $env:GEO_CONT_NAME
169
- docker logs $env:GEO_CONT_NAME
170
- docker rm $env:GEO_CONT_NAME
181
+ if ( $env:SKIP_UNSTABLE -match 'false')
182
+ {
183
+ docker stop $env:GEO_CONT_NAME
184
+ docker logs $env:GEO_CONT_NAME
185
+ docker rm $env:GEO_CONT_NAME
186
+ }
171
187
172
188
- name : Stop any remaining containers
173
189
if : always()
@@ -204,12 +220,9 @@ jobs:
204
220
python -m pip install --upgrade pip
205
221
pip install --upgrade build wheel
206
222
pip install .[doc]
207
- # TODO - To be removed once it is published
208
- pip uninstall --yes sphinx-autoapi
209
- pip install "sphinx-autoapi @ git+https://github.com/jorgepiloto/sphinx-autoapi@feat/single-page-option"
210
223
211
224
- name : Login to GitHub Container Registry
212
- uses : docker/login-action@v2
225
+ uses : docker/login-action@v3
213
226
with :
214
227
registry : ghcr.io
215
228
username : ${{ github.actor }}
@@ -280,6 +293,8 @@ jobs:
280
293
needs : [smoke-tests]
281
294
runs-on : ubuntu-latest
282
295
continue-on-error : ${{ matrix.experimental }}
296
+ env :
297
+ SKIP_UNSTABLE : ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
283
298
strategy :
284
299
fail-fast : false
285
300
matrix :
@@ -291,27 +306,33 @@ jobs:
291
306
292
307
steps :
293
308
- name : Login in Github Container registry
294
- uses : docker/login-action@v2
309
+ if : env.SKIP_UNSTABLE == 'false'
310
+ uses : docker/login-action@v3
295
311
with :
296
312
registry : ghcr.io
297
313
username : ${{ github.actor }}
298
314
password : ${{ secrets.GITHUB_TOKEN }}
299
315
300
316
- name : Pull and launch geometry service
317
+ if : env.SKIP_UNSTABLE == 'false'
301
318
run : |
302
319
docker pull ${{ env.ANSRV_GEO_IMAGE }}:${{ matrix.docker-image }}
303
320
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 }}:${{ matrix.docker-image }}
321
+
304
322
- name : Checkout repository
323
+ if : env.SKIP_UNSTABLE == 'false'
305
324
uses : actions/checkout@v4
306
325
307
326
- name : Restore images cache
327
+ if : env.SKIP_UNSTABLE == 'false'
308
328
uses : actions/cache@v3
309
329
with :
310
330
path : tests/integration/image_cache
311
331
key : pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}-${{ hashFiles('pyproject.toml') }}
312
332
restore-keys : pyvista-image-cache-${{ runner.os }}-v-${{ env.RESET_IMAGE_CACHE }}
313
333
314
334
- name : Run pytest
335
+ if : env.SKIP_UNSTABLE == 'false'
315
336
uses : ansys/actions/tests-pytest@v4
316
337
env :
317
338
ALLOW_PLOTTING : true
@@ -339,9 +360,12 @@ jobs:
339
360
- name : Stop the Geometry service
340
361
if : always()
341
362
run : |
342
- docker stop ${{ env.GEO_CONT_NAME }}
343
- docker logs ${{ env.GEO_CONT_NAME }}
344
- docker rm ${{ env.GEO_CONT_NAME }}
363
+ if [[ ${{ env.SKIP_UNSTABLE }} == 'false' ]];
364
+ then
365
+ docker stop ${{ env.GEO_CONT_NAME }}
366
+ docker logs ${{ env.GEO_CONT_NAME }}
367
+ docker rm ${{ env.GEO_CONT_NAME }}
368
+ fi
345
369
346
370
package :
347
371
name : Package library
@@ -439,6 +463,19 @@ jobs:
439
463
.\.venv\Scripts\Activate.ps1
440
464
pytest -v --use-existing-service=yes
441
465
466
+ - name : " Compressing Dockerfile.windows"
467
+ uses : vimtor/action-zip@v1.1
468
+ with :
469
+ files : docker/Dockerfile.windows
470
+ dest : windows-dockerfile.zip
471
+
472
+ - name : Upload Windows Dockerfile
473
+ uses : actions/upload-artifact@v3
474
+ with :
475
+ name : windows-dockerfile.zip
476
+ path : windows-dockerfile.zip
477
+ retention-days : 7
478
+
442
479
- name : Stop the Geometry service
443
480
if : always()
444
481
run : |
@@ -516,6 +553,19 @@ jobs:
516
553
checkout : false
517
554
requires-xvfb : true
518
555
556
+ - name : " Compressing Dockerfile.linux"
557
+ uses : vimtor/action-zip@v1.1
558
+ with :
559
+ files : docker/Dockerfile.linux
560
+ dest : linux-dockerfile.zip
561
+
562
+ - name : Upload Linux Dockerfile
563
+ uses : actions/upload-artifact@v3
564
+ with :
565
+ name : linux-dockerfile.zip
566
+ path : linux-dockerfile.zip
567
+ retention-days : 7
568
+
519
569
- name : Stop the Geometry service
520
570
if : always()
521
571
run : |
@@ -540,7 +590,7 @@ jobs:
540
590
uses : ansys/actions/release-github@v4
541
591
with :
542
592
library-name : ${{ env.PACKAGE_NAME }}
543
- additional-artifacts : windows-binaries.zip linux-binaries.zip
593
+ additional-artifacts : windows-binaries.zip windows-dockerfile.zip linux-binaries.zip linux-dockerfile .zip
544
594
545
595
upload_dev_docs :
546
596
name : Upload dev documentation
0 commit comments