From d9b9adcdae99d7522cd7ef191b8ad936d17c173a Mon Sep 17 00:00:00 2001 From: Predrag Gruevski Date: Sun, 14 Jul 2024 19:08:10 +0000 Subject: [PATCH] Add "all action stages" job to `test-action.yml` so nightly can fail. --- .github/workflows/test-action.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 27cbb03..e3bcae8 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -52,3 +52,24 @@ jobs: run: | echo "Error! The action should have failed because of the breaking change, but it has not." exit 1 + + # We need this job so that the overall workflow is considered a success + # even if the nightly portions of the test have failed. + complete: + name: All action stages + runs-on: ubuntu-latest + needs: + - run-tests + if: ${{ success() || failure() }} # Run this job even if a dependency has failed. + steps: + - name: Job outcomes + run: | + echo "run-tests: ${{ needs.run-tests.result }}" + + # Fail this required job if any of its dependent jobs have failed. + # + # Do not attempt to consolidate these steps into one step, it won't work. + # Multi-line `if` clauses are not evaluated properly: see the intermediate commits in + # https://github.com/obi1kenobi/cargo-semver-checks/pull/405 + - if: ${{ needs.run-tests.result != 'success' }} + run: exit 1