Skip to content

Commit cc8f6d6

Browse files
authored
ci: replace single gating check with vanilla skipping (#1008) [no-ci] (#1056)
* ci: replace single gating check with vanilla skipping (#1008) * ci: remove docs * ci: add back matrix filter
1 parent 9b579bc commit cc8f6d6

1 file changed

Lines changed: 91 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 91 additions & 29 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,38 +32,116 @@ 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+
matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))"
130+
131+
# WARNING: make sure both Linux test jobs are in sync
132+
test-linux-aarch64:
133+
strategy:
134+
fail-fast: false
135+
matrix:
136+
host-platform:
59137
- linux-aarch64
60138
name: Test ${{ matrix.host-platform }}
61139
if: ${{ github.repository_owner == 'nvidia' }}
62140
permissions:
63141
contents: read # This is required for actions/checkout
64142
needs:
65143
- ci-vars
66-
- build
144+
- build-linux-aarch64
67145
secrets: inherit
68146
uses: ./.github/workflows/test-wheel-linux.yml
69147
with:
@@ -84,7 +162,7 @@ jobs:
84162
contents: read # This is required for actions/checkout
85163
needs:
86164
- ci-vars
87-
- build
165+
- build-windows
88166
secrets: inherit
89167
uses: ./.github/workflows/test-wheel-windows.yml
90168
with:
@@ -93,30 +171,14 @@ jobs:
93171
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
94172
matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))"
95173

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 }}
111-
112174
checks:
113175
name: Check job status
114-
permissions:
115-
checks: read
176+
runs-on: ubuntu-latest
116177
needs:
117-
- build
118-
- test-linux
178+
- test-linux-64
179+
- test-linux-aarch64
119180
- test-windows
120-
# - doc
121-
secrets: inherit
122-
uses: ./.github/workflows/status-check.yml
181+
# we don't build docs on the backport branch, see #809
182+
steps:
183+
- name: Exit
184+
run: exit 0

0 commit comments

Comments
 (0)