Skip to content

Commit 63b68c1

Browse files
authored
Fix CI checks job to detect test failures (NVIDIA#1547)
The checks job only verified if jobs were cancelled, but did not check if they failed. This allowed PRs to merge even when tests failed because the checks job would exit with 0 (success) when tests had result='failure'. Add failure checks alongside the existing cancellation checks for all test jobs and the doc job.
1 parent ff449e6 commit 63b68c1

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -223,7 +223,7 @@ jobs:
223223
steps:
224224
- name: Exit
225225
run: |
226-
# if any dependencies were cancelled, that's a failure
226+
# if any dependencies were cancelled or failed, that's a failure
227227
#
228228
# see https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#always
229229
# and https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
@@ -243,13 +243,16 @@ jobs:
243243
# Note: When [doc-only] is in PR title, test jobs are intentionally
244244
# skipped and should not cause failure.
245245
doc_only=${{ needs.should-skip.outputs.doc-only }}
246-
if ${{ needs.doc.result == 'cancelled' }}; then
246+
if ${{ needs.doc.result == 'cancelled' || needs.doc.result == 'failure' }}; then
247247
exit 1
248248
fi
249249
if [[ "${doc_only}" != "true" ]]; then
250250
if ${{ needs.test-linux-64.result == 'cancelled' ||
251+
needs.test-linux-64.result == 'failure' ||
251252
needs.test-linux-aarch64.result == 'cancelled' ||
252-
needs.test-windows.result == 'cancelled' }}; then
253+
needs.test-linux-aarch64.result == 'failure' ||
254+
needs.test-windows.result == 'cancelled' ||
255+
needs.test-windows.result == 'failure' }}; then
253256
exit 1
254257
fi
255258
fi

0 commit comments

Comments
 (0)