Skip to content

Commit 4956096

Browse files
committed
Fix CI checks job to detect test failures
The checks job would exit 0 unconditionally, allowing PRs to merge even when tests failed. Add proper failure and cancellation checks for all test jobs, and add `if: always()` to ensure the job runs even when dependencies fail.
1 parent 46fb040 commit 4956096

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ jobs:
173173

174174
checks:
175175
name: Check job status
176+
if: always()
176177
runs-on: ubuntu-latest
177178
needs:
178179
- test-linux-64
@@ -181,4 +182,14 @@ jobs:
181182
# we don't build docs on the backport branch, see #809
182183
steps:
183184
- name: Exit
184-
run: exit 0
185+
run: |
186+
# if any dependencies were cancelled or failed, that's a failure
187+
if ${{ needs.test-linux-64.result == 'cancelled' ||
188+
needs.test-linux-64.result == 'failure' ||
189+
needs.test-linux-aarch64.result == 'cancelled' ||
190+
needs.test-linux-aarch64.result == 'failure' ||
191+
needs.test-windows.result == 'cancelled' ||
192+
needs.test-windows.result == 'failure' }}; then
193+
exit 1
194+
fi
195+
exit 0

0 commit comments

Comments
 (0)