From 58adb8677ddece233ec61bab0d72611d9a08c906 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Wed, 21 Aug 2024 15:22:40 -0400 Subject: [PATCH] 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 --- .github/workflows/build_wheels.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d8f1f54a5b..d4cf75d79a 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -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]