Skip to content

Commit adde28b

Browse files
authored
Fix workflow-complete jobs for GitHub workflows (#1723)
Updates jobs to always run and then fail, rather than be skipped when needed jobs fail. This will allow GitHub to correctly block when tests fail. `needs` JSON context: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#needs-context Equivalent CSI driver PR: awslabs/mountpoint-s3-csi-driver#661 ### Does this change impact existing behavior? CI change only. ### Does this change need a changelog entry? Does it require a version change? No, CI change only. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
1 parent a3d487c commit adde28b

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/integration.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ jobs:
449449
workflow-complete:
450450
name: "Integration Tests Complete"
451451
runs-on: ubuntu-latest
452+
if: always()
452453
needs:
453454
- fs-test
454455
- client-test
@@ -457,4 +458,5 @@ jobs:
457458
- metrics
458459
- test-rpm
459460
steps:
460-
- run: echo "Workflow complete"
461+
- name: Verify jobs succeeded
462+
run: echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")'

.github/workflows/tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ jobs:
384384
workflow-complete:
385385
name: "Tests Workflow Complete"
386386
runs-on: ubuntu-latest
387+
if: always()
387388
needs:
388389
- test
389390
- doc-tests
@@ -399,4 +400,5 @@ jobs:
399400
- package-script-checks
400401
- docker
401402
steps:
402-
- run: echo "Workflow complete"
403+
- name: Verify jobs succeeded
404+
run: echo '${{ toJSON(needs) }}' | jq -e 'to_entries | all(.value.result == "success")'

0 commit comments

Comments
 (0)