summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2024-11-09 15:04:51 +0100
committerGitHub <noreply@github.com>2024-11-09 06:04:51 -0800
commitb97015b791ca021ae6a1719940823c42fd87eeac (patch)
tree88fc5ea3d785f80fca1067939839e11d79dc6640 /.github/workflows/ci.yaml
parent1884520f7bc73e784f8638b73691081260af572e (diff)
downloadspack-b97015b791ca021ae6a1719940823c42fd87eeac.tar.gz
spack-b97015b791ca021ae6a1719940823c42fd87eeac.tar.bz2
spack-b97015b791ca021ae6a1719940823c42fd87eeac.tar.xz
spack-b97015b791ca021ae6a1719940823c42fd87eeac.zip
ci: ci/all must always run, and fail if any job has status "fail" or "canceled" (#47517)
This means it succeeds when a both jobs have either status "success" or status "skipped"
Diffstat (limited to '.github/workflows/ci.yaml')
-rw-r--r--.github/workflows/ci.yaml26
1 files changed, 22 insertions, 4 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 2024014f1b..a7ceb1bd8e 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -83,10 +83,17 @@ jobs:
all-prechecks:
needs: [ prechecks ]
+ if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Success
- run: "true"
+ run: |
+ if [ "${{ needs.prechecks.result }}" == "failure" ] || [ "${{ needs.prechecks.result }}" == "canceled" ]; then
+ echo "Unit tests failed."
+ exit 1
+ else
+ exit 0
+ fi
coverage:
needs: [ unit-tests, prechecks ]
@@ -94,8 +101,19 @@ jobs:
secrets: inherit
all:
- needs: [ coverage, bootstrap ]
+ needs: [ unit-tests, coverage, bootstrap ]
+ if: ${{ always() }}
runs-on: ubuntu-latest
+ # See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#needs-context
steps:
- - name: Success
- run: "true"
+ - name: Status summary
+ run: |
+ if [ "${{ needs.unit-tests.result }}" == "failure" ] || [ "${{ needs.unit-tests.result }}" == "canceled" ]; then
+ echo "Unit tests failed."
+ exit 1
+ elif [ "${{ needs.bootstrap.result }}" == "failure" ] || [ "${{ needs.bootstrap.result }}" == "canceled" ]; then
+ echo "Bootstrap tests failed."
+ exit 1
+ else
+ exit 0
+ fi