Skip to content

Commit

Permalink
ci: add tests-success meta-job
Browse files Browse the repository at this point in the history
When using GitHub branch protections, listing all jobs that must succeed
is a bit of a hassle, especially when those jobs change (e.g., when the
Python version that's used by default changes).

Instead, add a 'meta-job' which ensures all required jobs passes, and
fails otherwise. Using this approach, only a single check must be
configured in branch protections.

See: neos/neos-development-collection#3291
See: https://github.community/t/status-check-for-a-matrix-jobs/127354/7
  • Loading branch information
NicolasT committed Oct 15, 2021
1 parent 3c1fdf9 commit 2b86f0d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,18 @@ jobs:
nox --force-color --session=coverage -- xml
- name: Upload coverage report
uses: codecov/codecov-action@v2.1.0

tests-success:
runs-on: ubuntu-latest
needs:
- tests
- coverage
steps:
- name: Ensure tests succeeded
if: "${{ needs.tests.result != 'success' }}"
run: |
exit 1
- name: Ensure coverage succeeded
if: "${{ needs.coverage.result != 'success' }}"
run: |
exit 1

0 comments on commit 2b86f0d

Please sign in to comment.