Skip to content

Commit 5033d53

Browse files
committed
ci: skip unnecessary unstable tests
1 parent f7a10a4 commit 5033d53

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

.github/workflows/nightly_docker_test.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,52 @@ concurrency:
3535

3636
jobs:
3737

38+
manifests:
39+
name: Check Docker manifests
40+
runs-on: ubuntu-latest
41+
outputs:
42+
skip_dms: ${{ steps.services.outputs.skip_dms }}
43+
skip_core_windows: ${{ steps.services.outputs.skip_core_windows }}
44+
skip_core_linux: ${{ steps.services.outputs.skip_core_linux }}
45+
strategy:
46+
matrix:
47+
include:
48+
- container-stable: "windows-latest"
49+
container-unstable: "windows-latest-unstable"
50+
service: "dms"
51+
service-name: "Windows DMS"
52+
- container-stable: "core-windows-latest"
53+
container-unstable: "core-windows-latest-unstable"
54+
service: "core_windows"
55+
service-name: "Windows Core Service"
56+
- container-stable: "core-linux-latest"
57+
container-unstable: "core-linux-latest-unstable"
58+
service: "core_linux"
59+
service-name: "Linux Core Service"
60+
steps:
61+
- name: Check ${{ matrix.service-name }} manifest
62+
id: services
63+
run: |
64+
docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-stable }} > ${{ matrix.container-stable }}.json
65+
docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-unstable }} > ${{ matrix.container-unstable }}.json || "" > ${{ matrix.container-unstable }}.json
66+
67+
# Check if the manifests are the same (and if so, create an output that will skip the next job)
68+
if diff ${{ matrix.container-stable }}.json ${{ matrix.container-unstable }}.json; then
69+
echo "${{ matrix.service-name }} container manifests are the same... skipping"
70+
echo "skip_${{ matrix.service }}=1" >> "$GITHUB_OUTPUT"
71+
else
72+
echo "${{ matrix.service-name }} container manifests are different"
73+
echo "skip_${{ matrix.service }}=0" >> "$GITHUB_OUTPUT"
74+
fi
75+
3876
# =================================================================================================
3977
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4078
# =================================================================================================
4179

4280
windows-dms-tests:
4381
name: Windows DMS
44-
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
82+
needs: manifests
83+
if: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1 || needs.manifests.outputs.SKIP_DMS == '0' }}
4584
runs-on: [self-hosted, Windows, pygeometry]
4685
env:
4786
PYVISTA_OFF_SCREEN: true
@@ -146,7 +185,8 @@ jobs:
146185
147186
windows-core-tests:
148187
name: Windows Core Service
149-
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
188+
needs: manifests
189+
if: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1 || needs.manifests.outputs.SKIP_CORE_WINDOWS == '0' }}
150190
# runs-on: [self-hosted, Windows, pygeometry]
151191
runs-on: # TODO: Waiting for ansys-network runner to be updated
152192
group: pyansys-self-hosted
@@ -259,7 +299,8 @@ jobs:
259299

260300
linux-tests:
261301
name: Linux Core Service
262-
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
302+
needs: manifests
303+
if: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1 || needs.manifests.outputs.SKIP_CORE_LINUX == '0' }}
263304
runs-on: ubuntu-latest
264305

265306
steps:

0 commit comments

Comments
 (0)