Skip to content

Commit

Permalink
Add step to fail workflow if matrix branch fails
Browse files Browse the repository at this point in the history
Seems like this something we also need, as comment indicates.
  • Loading branch information
jonathanrainer committed Aug 12, 2024
1 parent 5fb9b2d commit 7761843
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,24 @@ jobs:
run: |
$E2E_BINARY=Get-ChildItem -Path .\${{ matrix.testing_target.binary_under_test }}\deps -File | Where-Object { $_.Name -like 'e2e-*.exe' } | ForEach-Object { $_.FullName }
Write-Output "Found '$E2E_BINARY'"
& $E2E_BINARY --ignored --nocapture
& $E2E_BINARY --ignored --nocapture
# It appears as though GitHub Actions mechanisms for handling errors within matrix job runs are... less than
# intuitive. There's an answer here (https://github.com/orgs/community/discussions/26822) that describes the
# fact that if any of the jobs in the matrix succeeds then the job is marked successful as well. So we
# have to intervene manually to ensure this job actually fails if any of the branches of the matrix fails.
#
# It might be the case we can simplify this as future GitHub Actions changes may render this obsolete, but for
# now this appears to be the only solution.
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [ smoke_tests ]
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}

0 comments on commit 7761843

Please sign in to comment.