ci: check for skipped and cancelled matrix jobs (#5840)

- Always run the job to check if any job of the test matrix failed.
- Check if any job of the test matrix was skipped or cancelled, and not
  just failed.
This commit is contained in:
Marco Ferrari 2024-07-04 22:24:12 +02:00 committed by GitHub
parent aa390de227
commit 32a200b72a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -258,6 +258,7 @@ jobs:
# having to select each individual job that dynamically add to the test matrix.
test-success-placeholder:
name: Check if all the tests passed
if: ${{ always() }}
runs-on: ubuntu-latest
permissions:
contents: read
@ -266,10 +267,10 @@ jobs:
- test-local-action
steps:
- name: Test suite success
if: ${{ !(contains(needs.*.result, 'failure')) }}
if: ${{ !(contains(needs.*.result, 'failure')) && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'skipped') }}
run: exit 0
- name: Test suite failures
if: ${{ contains(needs.*.result, 'failure') }}
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
run: exit 1
preview-release-notes: