Skip to content

Commit

Permalink
Update status check job to check status of precursor jobs (NVIDIA#605)
Browse files Browse the repository at this point in the history
* Update status check job to check status of precursor jobs.

* Use always() instead of !cancelled()

Normally you want to avoid `always()` in favor of `!cancelled()`, but in this case we want to use `always()` because using `!cancelled()` would lead to the `ci` job being skipped, which would report as a success for the status check.
  • Loading branch information
jrhemstad authored Oct 25, 2023
1 parent 8e89bde commit 2a23cfb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ jobs:

# This job is the final job that runs after all other jobs and is used for branch protection status checks.
# See: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks
# https://github.com/orgs/community/discussions/26822#discussioncomment-5122101
ci:
runs-on: ubuntu-latest
name: CI
if: ${{ always() }} # need to use always() instead of !cancelled() because skipped jobs count as success
needs:
- clang-cuda
- cub
Expand All @@ -162,4 +164,11 @@ jobs:
- cccl-infra
- verify-devcontainers
steps:
- run: echo "CI success"
- name: Check status of all precursor jobs
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
run: exit 1

0 comments on commit 2a23cfb

Please sign in to comment.