Skip to content

Commit 58adb86

Browse files
committed
ci: Ensure "Build and test wheels" can fail
We added the "Build and test wheels" job as a required check to our CI in order to avoid needing to list every possible matrix job as required, but this didn't actually work as intended: the job never failed, it always either passed or was skipped, and GitHub doesn't count a skipped job as a failing check. Work around this with a different approach: ensure that this job always runs, and succeeds if and only if all of its dependencies succeeded. Signed-off-by: Matt Wozniski <[email protected]>
1 parent 5f2832f commit 58adb86

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/build_wheels.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,15 @@ jobs:
174174
name: Build and test wheels
175175
needs: [build_linux_wheels, build_macosx_wheels]
176176
runs-on: ubuntu-latest
177+
if: always() # Don't skip this step if a predecessor failed!
177178
steps:
178179
# We can't make a matrix job itself a required check in GitHub,
179180
# so we instead add a job that depends on the two matrix jobs,
180181
# and we mark this job as required instead. This job doesn't do
181182
# any work, it just lets us better manage our required checks.
182-
- run: echo "Done!"
183+
- if: "!success()"
184+
run: echo "Some builds failed" && exit 1
185+
- run: echo "All builds succeeded!"
183186

184187
upload_pypi:
185188
needs: [build_and_test_wheels, build_sdist]

0 commit comments

Comments
 (0)