Skip to content

Commit 4e902b8

Browse files
committed
ci: replace single gating check with vanilla skipping (NVIDIA#1008)
1 parent 9b579bc commit 4e902b8

File tree

1 file changed

+105
-30
lines changed

1 file changed

+105
-30
lines changed

.github/workflows/ci.yml

Lines changed: 105 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
CUDA_BUILD_VER: ${{ steps.get-vars.outputs.cuda_build_ver }}
2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
fetch-depth: 0
2929
- name: Get CUDA build version
@@ -32,45 +32,121 @@ 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-
build:
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+
55+
# WARNING: make sure all of the build jobs are in sync
56+
build-linux-64:
3657
needs:
3758
- ci-vars
59+
- should-skip
3860
strategy:
3961
fail-fast: false
4062
matrix:
4163
host-platform:
4264
- linux-64
65+
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
66+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
67+
secrets: inherit
68+
uses: ./.github/workflows/build-wheel.yml
69+
with:
70+
host-platform: ${{ matrix.host-platform }}
71+
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
72+
73+
# WARNING: make sure all of the build jobs are in sync
74+
build-linux-aarch64:
75+
needs:
76+
- ci-vars
77+
- should-skip
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
host-platform:
4382
- linux-aarch64
83+
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
84+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
85+
secrets: inherit
86+
uses: ./.github/workflows/build-wheel.yml
87+
with:
88+
host-platform: ${{ matrix.host-platform }}
89+
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
90+
91+
# WARNING: make sure all of the build jobs are in sync
92+
build-windows:
93+
needs:
94+
- ci-vars
95+
- should-skip
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
host-platform:
44100
- win-64
45101
name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
46-
if: ${{ github.repository_owner == 'nvidia' }}
102+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
47103
secrets: inherit
48104
uses: ./.github/workflows/build-wheel.yml
49105
with:
50106
host-platform: ${{ matrix.host-platform }}
51107
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
52108

53-
test-linux:
109+
# WARNING: make sure both Linux test jobs are in sync
110+
test-linux-64:
54111
strategy:
55112
fail-fast: false
56113
matrix:
57114
host-platform:
58115
- linux-64
116+
name: Test ${{ matrix.host-platform }}
117+
if: ${{ github.repository_owner == 'nvidia' }}
118+
permissions:
119+
contents: read # This is required for actions/checkout
120+
needs:
121+
- ci-vars
122+
- build-linux-64
123+
secrets: inherit
124+
uses: ./.github/workflows/test-wheel-linux.yml
125+
with:
126+
build-type: pull-request
127+
host-platform: ${{ matrix.host-platform }}
128+
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
129+
130+
# WARNING: make sure both Linux test jobs are in sync
131+
test-linux-aarch64:
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
host-platform:
59136
- linux-aarch64
60137
name: Test ${{ matrix.host-platform }}
61138
if: ${{ github.repository_owner == 'nvidia' }}
62139
permissions:
63140
contents: read # This is required for actions/checkout
64141
needs:
65142
- ci-vars
66-
- build
143+
- build-linux-aarch64
67144
secrets: inherit
68145
uses: ./.github/workflows/test-wheel-linux.yml
69146
with:
70147
build-type: pull-request
71148
host-platform: ${{ matrix.host-platform }}
72149
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
73-
matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))"
74150

75151
test-windows:
76152
strategy:
@@ -84,39 +160,38 @@ jobs:
84160
contents: read # This is required for actions/checkout
85161
needs:
86162
- ci-vars
87-
- build
163+
- build-windows
88164
secrets: inherit
89165
uses: ./.github/workflows/test-wheel-windows.yml
90166
with:
91167
build-type: pull-request
92168
host-platform: ${{ matrix.host-platform }}
93169
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
94-
matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))"
95170

96-
# doc:
97-
# name: Docs
98-
# if: ${{ github.repository_owner == 'nvidia' }}
99-
# # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
100-
# permissions:
101-
# id-token: write
102-
# contents: write
103-
# pull-requests: write
104-
# needs:
105-
# - ci-vars
106-
# - build
107-
# secrets: inherit
108-
# uses: ./.github/workflows/build-docs.yml
109-
# with:
110-
# build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
171+
doc:
172+
name: Docs
173+
if: ${{ github.repository_owner == 'nvidia' }}
174+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
175+
permissions:
176+
id-token: write
177+
contents: write
178+
pull-requests: write
179+
needs:
180+
- ci-vars
181+
- build-linux-64
182+
secrets: inherit
183+
uses: ./.github/workflows/build-docs.yml
184+
with:
185+
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
111186

112187
checks:
113188
name: Check job status
114-
permissions:
115-
checks: read
189+
runs-on: ubuntu-latest
116190
needs:
117-
- build
118-
- test-linux
191+
- test-linux-64
192+
- test-linux-aarch64
119193
- test-windows
120-
# - doc
121-
secrets: inherit
122-
uses: ./.github/workflows/status-check.yml
194+
- doc
195+
steps:
196+
- name: Exit
197+
run: exit 0

0 commit comments

Comments
 (0)