Skip to content

Commit 1e4c9ea

Browse files
authored
Add a job to join the nox matrix jobs (#661)
This job is only used to have a single job we can require in branch protection rules, so we don't have to update the protection rules each time we add or remove a job from the matrix.
2 parents 7dc3bda + d3a8258 commit 1e4c9ea

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ jobs:
7979
run: nox -R -e "$NOX_SESSION"
8080
timeout-minutes: 10
8181

82+
# This job runs if all the `nox` matrix jobs ran and succeeded.
83+
# It is only used to have a single job that we can require in branch
84+
# protection rules, so we don't have to update the protection rules each time
85+
# we add or remove a job from the matrix.
86+
nox-all:
87+
# The job name should match the name of the `nox` job.
88+
name: Test with nox
89+
needs: ["nox"]
90+
runs-on: ubuntu-20.04
91+
steps:
92+
- name: Return true
93+
run: "true"
94+
8295
nox-cross-arch:
8396
name: Cross-arch tests with nox
8497
if: github.event_name != 'pull_request'
@@ -172,22 +185,25 @@ jobs:
172185
if: always()
173186
run: sudo chown -R $USER:$USER /tmp/pip-cache
174187

175-
# This job runs if `nox-cross-arch` ran and succeeded.
176-
# This is required because, when the `nox-cross-arch` job is skipped, its
177-
# inner matrix is not expanded, and branch protection rules on the
178-
# inner-matrix jobs get stuck. So instead of `nox-cross-arch`, this job can be
179-
# used in the branch protection rules.
180-
# At the time of writing this, there is an ongoing discussion about this here:
188+
# This job runs if all the `nox-cross-arch` matrix jobs ran and succeeded.
189+
# As the `nox-all` job, its main purpose is to provide a single point of
190+
# reference in branch protection rules, similar to how `nox-all` operates.
191+
# However, there's a crucial difference: the `nox-cross-arch` job is omitted
192+
# in PRs. Without the `nox-cross-arch-all` job, the inner matrix wouldn't be
193+
# expanded in such scenarios. This would lead to the CI indefinitely waiting
194+
# for these jobs to complete due to the branch protection rules, essentially
195+
# causing it to hang. This behavior is tied to a recognized GitHub matrices
196+
# issue when certain jobs are skipped. For a deeper understanding, refer to:
181197
# https://github.com/orgs/community/discussions/9141
182198
nox-cross-arch-all:
199+
# The job name should match the name of the `nox-cross-arch` job.
183200
name: Cross-arch tests with nox
184201
needs: ["nox-cross-arch"]
185202
runs-on: ubuntu-20.04
186203
steps:
187204
- name: Return true
188205
run: "true"
189206

190-
191207
build:
192208
name: Build distribution packages
193209
runs-on: ubuntu-20.04

0 commit comments

Comments
 (0)