Skip to content

Commit fee6637

Browse files
Update conditions for CI *-all jobs based on results
The current condition for the `*-all` jobs in the CI were not correct, as it was skipping the job if the matrix job succeeded, which is not the desired behavior. We want to skip the *-all job only if the matrix job was skipped. The results for `*-all` jobs are now set based on the matrix job results. Signed-off-by: Daniel Zullo <[email protected]>
1 parent e352aa8 commit fee6637

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ jobs:
8989
# The job name should match the name of the `nox` job.
9090
name: Test with nox
9191
needs: ["nox"]
92+
# We skip this job only if nox was also skipped
93+
if: always() && needs.nox.result != 'skipped'
9294
runs-on: ubuntu-20.04
95+
env:
96+
DEPS_RESULT: ${{ needs.nox.result }}
9397
steps:
94-
- name: Return true
95-
run: "true"
98+
- name: Check matrix job result
99+
run: test "$DEPS_RESULT" = "success"
96100

97101
nox-cross-arch:
98102
name: Cross-arch tests with nox
@@ -202,10 +206,14 @@ jobs:
202206
# The job name should match the name of the `nox-cross-arch` job.
203207
name: Cross-arch tests with nox
204208
needs: ["nox-cross-arch"]
209+
# We skip this job only if nox-cross-arch was also skipped
210+
if: always() && needs.nox-cross-arch.result != 'skipped'
205211
runs-on: ubuntu-20.04
212+
env:
213+
DEPS_RESULT: ${{ needs.nox-cross-arch.result }}
206214
steps:
207-
- name: Return true
208-
run: "true"
215+
- name: Check matrix job result
216+
run: test "$DEPS_RESULT" = "success"
209217

210218
build:
211219
name: Build distribution packages
@@ -279,10 +287,14 @@ jobs:
279287
# The job name should match the name of the `test-installation` job.
280288
name: Test package installation in different architectures
281289
needs: ["test-installation"]
290+
# We skip this job only if test-installation was also skipped
291+
if: always() && needs.test-installation.result != 'skipped'
282292
runs-on: ubuntu-20.04
293+
env:
294+
DEPS_RESULT: ${{ needs.test-installation.result }}
283295
steps:
284-
- name: Return true
285-
run: "true"
296+
- name: Check matrix job result
297+
run: test "$DEPS_RESULT" = "success"
286298

287299
test-docs:
288300
name: Test documentation website generation

0 commit comments

Comments
 (0)