Skip to content

Commit

Permalink
adding in fix for success jobs getting skipped. (#17132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret authored Apr 25, 2023
1 parent 7521559 commit e5ef916
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,12 @@ jobs:
- setup
- dev-build-push
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: |
(always() && ! cancelled()) &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: ${{ always() }}
steps:
- run: echo "build-artifacts succeeded"
- name: evaluate upstream job results
run: |
# exit 1 if failure or cancelled result for any upstream job
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
exit 1
fi
13 changes: 8 additions & 5 deletions .github/workflows/build-distros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ jobs:
- build-amd64
- build-arm
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: |
(always() && ! cancelled()) &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: ${{ always() }}
steps:
- run: echo "build-distros succeeded"
- name: evaluate upstream job results
run: |
# exit 1 if failure or cancelled result for any upstream job
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
exit 1
fi
13 changes: 8 additions & 5 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ jobs:
- node-tests
- ember-build-test
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: |
(always() && ! cancelled()) &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: ${{ always() }}
steps:
- run: echo "frontend succeeded"
- name: evaluate upstream job results
run: |
# exit 1 if failure or cancelled result for any upstream job
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
exit 1
fi
13 changes: 8 additions & 5 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,12 @@ jobs:
- go-test-sdk-1-20
- go-test-32bit
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: |
(always() && ! cancelled()) &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: ${{ always() }}
steps:
- run: echo "go-tests succeeded"
- name: evaluate upstream job results
run: |
# exit 1 if failure or cancelled result for any upstream job
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
exit 1
fi
13 changes: 8 additions & 5 deletions .github/workflows/test-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,12 @@ jobs:
- generate-upgrade-job-matrices
- upgrade-integration-test
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: |
(always() && ! cancelled()) &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
if: ${{ always() }}
steps:
- run: echo "test-integrations succeeded"
- name: evaluate upstream job results
run: |
# exit 1 if failure or cancelled result for any upstream job
if printf '${{ toJSON(needs) }}' | grep -E -i '\"result\": \"(failure|cancelled)\"'; then
printf "Tests failed or workflow cancelled:\n\n${{ toJSON(needs) }}"
exit 1
fi

0 comments on commit e5ef916

Please sign in to comment.