ci: run a job on test suite success (#5687)

- Run a job after all the jobs in the dynamically built test matrix run
  to completion. This job is useful for branch protection rules that
  that need the whole test suite to run successfully.
- Fix linting issues.

Fix #5686
This commit is contained in:
Marco Ferrari 2024-05-24 23:09:39 +02:00 committed by GitHub
parent c4eb4c204d
commit a86fbaf65e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View file

@ -155,7 +155,7 @@ jobs:
- name: Update action.yml - name: Update action.yml
run: | run: |
echo "yq version: $(yq --version)" echo "yq version: $(yq --version)"
yq '.runs.image = env(CONTAINER_IMAGE_ID)' -i action.yml yq '.runs.image = "docker://" + env(CONTAINER_IMAGE_ID)' -i action.yml
echo "Action file contents:" echo "Action file contents:"
cat action.yml cat action.yml
@ -253,6 +253,25 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The purpose of this job is to run only when the run-test-suite job runs to completion.
# We can use this job as a required status check in a branch protection rule without
# having to select each individual job that dynamically add to the test matrix.
test-success-placeholder:
name: Check if all the tests passed
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- run-test-suite
- test-local-action
steps:
- name: Test suite success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Test suite failures
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
preview-release-notes: preview-release-notes:
if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name && github.repository == 'super-linter/super-linter' if: github.event_name == 'pull_request' && github.repository == github.event.pull_request.head.repo.full_name && github.repository == 'super-linter/super-linter'
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -8,7 +8,6 @@ jobs:
github_actions_good: github_actions_good:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2
- if: ${{ github.actor == 'dependabot[bot]' }} - if: ${{ github.actor == 'dependabot[bot]' }}
run: | run: |
# CMD # CMD