Skip to content

Commit

Permalink
Add a “Final Results” job to the matrix Workflows
Browse files Browse the repository at this point in the history
This ensures all matrix tests have passed, allowing us
to add one required step for each workflow, rather than
having to require a passing status for each individual
Ruby / Rails version.
  • Loading branch information
pezholio committed May 20, 2024
1 parent 5e8003c commit 8486c81
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/rails-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,19 @@ jobs:
run: |
docker run --rm -e "NOTIFY_API_KEY=$NOTIFY_API_KEY" \
mail-notify-integration-rails-${{ matrix.rails }}:latest bin/rails test
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs:
- mailer-previews
- sending
steps:
# If any of the previous actions failed, we return a non-zero exit code
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
14 changes: 14 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ jobs:
uses: coverallsapp/github-action@v2
with:
fail-on-error: false
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [ unit-tests ]
steps:
# If any of the previous actions failed, we return a non-zero exit code
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}

0 comments on commit 8486c81

Please sign in to comment.