@@ -102,20 +102,71 @@ jobs:
102
102
directory : docker
103
103
recursive : true
104
104
105
+ manifests :
106
+ name : Check Docker manifests
107
+ runs-on : ubuntu-latest
108
+ outputs :
109
+ skip_dms : ${{ steps.services.outputs.skip_dms }}
110
+ skip_core_windows : ${{ steps.services.outputs.skip_core_windows }}
111
+ skip_core_linux : ${{ steps.services.outputs.skip_core_linux }}
112
+ strategy :
113
+ matrix :
114
+ include :
115
+ - container-stable : " windows-latest"
116
+ container-unstable : " windows-latest-unstable"
117
+ service : " dms"
118
+ service-name : " Windows DMS"
119
+ - container-stable : " core-windows-latest"
120
+ container-unstable : " core-windows-latest-unstable"
121
+ service : " core_windows"
122
+ service-name : " Windows Core Service"
123
+ - container-stable : " core-linux-latest"
124
+ container-unstable : " core-linux-latest-unstable"
125
+ service : " core_linux"
126
+ service-name : " Linux Core Service"
127
+ steps :
128
+ - name : Login to 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
+
135
+ - name : Check ${{ matrix.service-name }} manifest
136
+ id : services
137
+ run : |
138
+ docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-stable }} > ${{ matrix.container-stable }}.json
139
+ docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-unstable }} > ${{ matrix.container-unstable }}.json || true
140
+
141
+ # Verify that the unstable manifest exists - otherwise create an empty file
142
+ if [ ! -f ${{ matrix.container-unstable }}.json ]; then
143
+ touch ${{ matrix.container-unstable }}.json
144
+ fi
145
+
146
+
147
+ # Check if the manifests are the same (and if so, create an output that will skip the next job)
148
+ if diff ${{ matrix.container-stable }}.json ${{ matrix.container-unstable }}.json; then
149
+ echo "${{ matrix.service-name }} container manifests are the same... skipping"
150
+ echo "skip_${{ matrix.service }}=1" >> "$GITHUB_OUTPUT"
151
+ else
152
+ echo "${{ matrix.service-name }} container manifests are different"
153
+ echo "skip_${{ matrix.service }}=0" >> "$GITHUB_OUTPUT"
154
+ fi
155
+
105
156
# =================================================================================================
106
157
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
107
158
# =================================================================================================
108
159
109
160
testing-windows :
110
161
name : Testing and coverage (Windows)
111
- needs : [smoke-tests]
162
+ needs : [smoke-tests, manifests ]
112
163
# runs-on: [self-hosted, Windows, pygeometry]
113
164
runs-on : # TODO: Waiting for ansys-network runner to be updated
114
165
group : pyansys-self-hosted
115
166
labels : [self-hosted, Windows, pygeometry]
116
167
continue-on-error : ${{ matrix.experimental }}
117
168
env :
118
- SKIP_UNSTABLE : ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
169
+ SKIP_UNSTABLE : false
119
170
PYVISTA_OFF_SCREEN : true
120
171
strategy :
121
172
fail-fast : false
@@ -131,6 +182,30 @@ jobs:
131
182
experimental : true
132
183
133
184
steps :
185
+ - name : Calculate SKIP_UNSTABLE
186
+ if : matrix.experimental
187
+ run : |
188
+ # Choose the manifests output to consider (for DMS or Core service)
189
+ # based on the matrix value
190
+ if ("${{ matrix.docker-image }}" -eq "windows-latest-unstable") {
191
+ $ImagesAreEqual = ${{ needs.manifests.outputs.skip_dms }}
192
+ } elseif ("${{ matrix.docker-image }}" -eq "core-windows-latest-unstable") {
193
+ $ImagesAreEqual = ${{ needs.manifests.outputs.skip_core_windows }}
194
+ } else {
195
+ Write-Output "Unknown docker image"
196
+ exit 1
197
+ }
198
+
199
+ $A = $env:SKIP_UNSTABLE_CONTAINERS_TEMPORARILY -eq 1
200
+ $B = $ImagesAreEqual -eq 1
201
+
202
+ # Calculate the logical expression
203
+ $Result = ($A -or $B).ToString().ToLower()
204
+
205
+ # Export it as an environment variable with true/false value
206
+ Write-Output "SKIP_UNSTABLE=$Result" | Out-File -FilePath $env:GITHUB_ENV -Append
207
+ Write-Output "SKIP_UNSTABLE will be: $Result"
208
+
134
209
- uses : actions/checkout@v4
135
210
if : env.SKIP_UNSTABLE == 'false'
136
211
@@ -329,11 +404,11 @@ jobs:
329
404
330
405
testing-linux :
331
406
name : Testing and coverage (Linux)
332
- needs : [smoke-tests]
407
+ needs : [smoke-tests, manifests ]
333
408
runs-on : ubuntu-latest
334
409
continue-on-error : ${{ matrix.experimental }}
335
410
env :
336
- SKIP_UNSTABLE : ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
411
+ SKIP_UNSTABLE : false
337
412
strategy :
338
413
fail-fast : false
339
414
matrix :
@@ -344,6 +419,28 @@ jobs:
344
419
experimental : true
345
420
346
421
steps :
422
+ - name : Calculate SKIP_UNSTABLE
423
+ if : matrix.experimental
424
+ run : |
425
+ # Choose the manifests output to consider (for Core service)
426
+ # based on the matrix value
427
+ if [[ "${{ matrix.docker-image }}" == "core-linux-latest-unstable" ]]; then
428
+ ImagesAreEqual=${{ needs.manifests.outputs.skip_core_linux }}
429
+ else
430
+ echo "Unknown docker image"
431
+ exit 1
432
+ fi
433
+
434
+ A=$([[ "$SKIP_UNSTABLE_CONTAINERS_TEMPORARILY" == "1" ]] && echo true || echo false)
435
+ B=$([[ "$ImagesAreEqual" == "1" ]] && echo true || echo false)
436
+
437
+ # Calculate the logical expression
438
+ Result=$([[ "$A" == true || "$B" == true ]] && echo true || echo false)
439
+
440
+ # Export it as an environment variable with true/false value
441
+ echo "SKIP_UNSTABLE=$Result" >> $GITHUB_ENV
442
+ echo "SKIP_UNSTABLE will be: $Result"
443
+
347
444
- name : Login in Github Container registry
348
445
if : env.SKIP_UNSTABLE == 'false'
349
446
uses : docker/login-action@v3
0 commit comments