Skip to content

Commit

Permalink
ci: Ensure "Build and test wheels" can fail
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
godlygeek committed Aug 21, 2024
1 parent 5f2832f commit 58adb86
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,15 @@ jobs:
name: Build and test wheels
needs: [build_linux_wheels, build_macosx_wheels]
runs-on: ubuntu-latest
if: always() # Don't skip this step if a predecessor failed!
steps:
# We can't make a matrix job itself a required check in GitHub,
# so we instead add a job that depends on the two matrix jobs,
# and we mark this job as required instead. This job doesn't do
# any work, it just lets us better manage our required checks.
- run: echo "Done!"
- if: "!success()"
run: echo "Some builds failed" && exit 1
- run: echo "All builds succeeded!"

upload_pypi:
needs: [build_and_test_wheels, build_sdist]
Expand Down

0 comments on commit 58adb86

Please sign in to comment.