Skip to content

Commit 598874c

Browse files
authored
ci: replace single gating check with vanilla skipping (#1008)
1 parent c4bb623 commit 598874c

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,38 @@ jobs:
3232
cuda_build_ver=$(jq -r .cuda.build.version ci/versions.json)
3333
echo "cuda_build_ver=$cuda_build_ver" >> $GITHUB_OUTPUT
3434
35+
should-skip:
36+
runs-on: ubuntu-latest
37+
outputs:
38+
skip: ${{ steps.get-should-skip.outputs.skip }}
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42+
- name: Compute whether to skip builds and tests
43+
id: get-should-skip
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
set -euxo pipefail
48+
if ${{ startsWith(github.ref_name, 'pull-request/') }}; then
49+
skip="$(gh pr view "$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')" --json title --jq '.title | contains("[no-ci]")')"
50+
else
51+
skip=false
52+
fi
53+
echo "skip=${skip}" >> "$GITHUB_OUTPUT"
54+
3555
# WARNING: make sure all of the build jobs are in sync
3656
build-linux-64:
3757
needs:
3858
- ci-vars
59+
- should-skip
3960
strategy:
4061
fail-fast: false
4162
matrix:
4263
host-platform:
4364
- linux-64
4465
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
45-
if: ${{ github.repository_owner == 'nvidia' }}
66+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
4667
secrets: inherit
4768
uses: ./.github/workflows/build-wheel.yml
4869
with:
@@ -53,13 +74,14 @@ jobs:
5374
build-linux-aarch64:
5475
needs:
5576
- ci-vars
77+
- should-skip
5678
strategy:
5779
fail-fast: false
5880
matrix:
5981
host-platform:
6082
- linux-aarch64
6183
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
62-
if: ${{ github.repository_owner == 'nvidia' }}
84+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
6385
secrets: inherit
6486
uses: ./.github/workflows/build-wheel.yml
6587
with:
@@ -70,13 +92,14 @@ jobs:
7092
build-windows:
7193
needs:
7294
- ci-vars
95+
- should-skip
7396
strategy:
7497
fail-fast: false
7598
matrix:
7699
host-platform:
77100
- win-64
78101
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
79-
if: ${{ github.repository_owner == 'nvidia' }}
102+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
80103
secrets: inherit
81104
uses: ./.github/workflows/build-wheel.yml
82105
with:
@@ -163,15 +186,12 @@ jobs:
163186

164187
checks:
165188
name: Check job status
166-
permissions:
167-
checks: read
189+
runs-on: ubuntu-latest
168190
needs:
169-
- build-linux-64
170191
- test-linux-64
171-
- build-linux-aarch64
172192
- test-linux-aarch64
173-
- build-windows
174193
- test-windows
175194
- doc
176-
secrets: inherit
177-
uses: ./.github/workflows/status-check.yml
195+
steps:
196+
- name: Exit
197+
run: exit 0

.github/workflows/status-check.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)