From ec7b11787834cc674449c717efcbc72dbf87fbb9 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Sat, 10 Jun 2023 14:07:17 +1000 Subject: [PATCH] chore: add gen and test-go-race to required check (#7952) --- .github/workflows/ci.yaml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1a2475b842..4ee4fddb1e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -565,12 +565,25 @@ jobs: required: runs-on: ubuntu-latest - needs: [test-go, test-go-pg, test-js] - # allow this job to run even if the previous jobs are skipped - if: | - always() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') + needs: [gen, test-go, test-go-pg, test-go-race, test-js] + # Allow this job to run even if the needed jobs fail, are skipped or + # cancelled. + if: always() steps: - name: Ensure required checks - run: echo "Required checks have passed" + run: | + echo "Checking required checks" + echo "- gen: ${{ needs.gen.result }}" + echo "- test-go: ${{ needs.test-go.result }}" + echo "- test-go-pg: ${{ needs.test-go-pg.result }}" + echo "- test-go-race: ${{ needs.test-go-race.result }}" + echo "- test-js: ${{ needs.test-js.result }}" + echo + + # We allow skipped jobs to pass, but not failed or cancelled jobs. + if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then + echo "One of the required checks has failed or has been cancelled" + exit 1 + fi + + echo "Required checks have passed"