Skip to content

Commit 2b77ca3

Browse files
committed
Add back in Windows build and test
1 parent 5f771f6 commit 2b77ca3

3 files changed

Lines changed: 93 additions & 23 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
matrix:
2323
python-version:
2424
- "3.9"
25+
- "3.12"
2526
- "3.13"
2627
name: py${{ matrix.python-version }}
2728
runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') ||

.github/workflows/ci.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
host-platform:
2222
- linux-64
2323
- linux-aarch64
24-
#- win-64
24+
- win-64
2525
name: Build ${{ matrix.host-platform }}, CUDA 12.8.0
2626
if: ${{ github.repository_owner == 'nvidia' }}
2727
secrets: inherit
@@ -34,7 +34,6 @@ jobs:
3434
test-linux:
3535
strategy:
3636
fail-fast: false
37-
# TODO: add driver version here
3837
matrix:
3938
host-platform:
4039
- linux-64
@@ -52,3 +51,23 @@ jobs:
5251
build-type: pull-request
5352
host-platform: ${{ matrix.host-platform }}
5453
build-ctk-ver: 12.8.0
54+
55+
test-windows:
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
host-platform:
60+
- win-64
61+
name: Test ${{ matrix.host-platform }}
62+
if: ${{ github.repository_owner == 'nvidia' }}
63+
permissions:
64+
contents: read # This is required for actions/checkout
65+
needs:
66+
- build
67+
secrets: inherit
68+
uses:
69+
./.github/workflows/test-wheel-windows.yml
70+
with:
71+
build-type: pull-request
72+
host-platform: ${{ matrix.host-platform }}
73+
build-ctk-ver: 12.8.0

.github/workflows/test-wheel-windows.yml

Lines changed: 71 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,80 @@ name: "CI: Test wheels"
77
on:
88
workflow_call:
99
inputs:
10-
host-platform:
10+
build-type:
1111
type: string
1212
required: true
13-
python-version:
13+
host-platform:
1414
type: string
1515
required: true
1616
build-ctk-ver:
1717
type: string
1818
required: true
19-
cuda-version:
19+
matrix_filter:
2020
type: string
21-
required: true
22-
local-ctk:
23-
type: string
24-
required: true
25-
runner:
26-
type: string
27-
required: true
21+
default: "."
2822

2923
jobs:
24+
compute-matrix:
25+
runs-on: ubuntu-latest
26+
env:
27+
BUILD_TYPE: ${{ inputs.build-type }}
28+
ARCH: ${{ (inputs.host-platform == 'win-64' && 'amd64') }}
29+
outputs:
30+
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
31+
steps:
32+
- name: Validate Test Type
33+
run: |
34+
if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then
35+
echo "Invalid build type! Must be one of 'nightly', 'pull-request', or 'branch'."
36+
exit 1
37+
fi
38+
- name: Compute Python Test Matrix
39+
id: compute-matrix
40+
run: |
41+
set -eo pipefail
42+
43+
# Please keep the matrices sorted in ascending order by the following:
44+
#
45+
# [PY_VER, CUDA_VER, LOCAL_CTK]
46+
#
47+
export MATRICES="
48+
pull-request:
49+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' }
50+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' }
51+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '0' }
52+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '1' }
53+
nightly:
54+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' }
55+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' }
56+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '0' }
57+
- { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.8.0', LOCAL_CTK: '1' }
58+
"
59+
60+
# Use the nightly matrix for branch tests
61+
MATRIX_TYPE="${BUILD_TYPE}"
62+
if [[ "${MATRIX_TYPE}" == "branch" ]]; then
63+
MATRIX_TYPE="nightly"
64+
fi
65+
export MATRIX_TYPE
66+
TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]')
67+
export TEST_MATRIX
68+
69+
MATRIX="$(
70+
yq -n -o json 'env(TEST_MATRIX)' | \
71+
jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end'
72+
)"
73+
74+
echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}"
75+
3076
test:
3177
# The build stage could fail but we want the CI to keep moving.
78+
needs: compute-matrix
79+
strategy:
80+
fail-fast: false
81+
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
3282
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
33-
runs-on: ${{ (inputs.runner == 'default' && inputs.host-platform == 'win-64' && 'cuda-python-windows-gpu-github') }}
83+
runs-on: 'cuda-python-windows-gpu-github'
3484
steps:
3585
- name: Checkout ${{ github.event.repository.name }}
3686
uses: actions/checkout@v4
@@ -46,11 +96,11 @@ jobs:
4696

4797
- name: Set environment variables
4898
run: |
49-
$PYTHON_VERSION_FORMATTED = '${{ inputs.python-version }}' -replace '\.'
99+
$PYTHON_VERSION_FORMATTED = '${{ matrix.PY_VER }}' -replace '\.'
50100
$REPO_DIR = $PWD.Path
51101
52102
$BUILD_CUDA_MAJOR = '${{ inputs.build-ctk-ver }}' -split '\.' | Select-Object -First 1
53-
$TEST_CUDA_MAJOR = '${{ inputs.cuda-version }}' -split '\.' | Select-Object -First 1
103+
$TEST_CUDA_MAJOR = '${{ matrix.CUDA_VER }}' -split '\.' | Select-Object -First 1
54104
if ($BUILD_CUDA_MAJOR -ne $TEST_CUDA_MAJOR) {
55105
$SKIP_CUDA_BINDINGS_TEST = 1
56106
} else {
@@ -174,24 +224,24 @@ jobs:
174224
Get-Location
175225
Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName
176226
177-
- name: Set up Python ${{ inputs.python-version }}
227+
- name: Set up Python ${{ matrix.PY_VER }}
178228
uses: actions/setup-python@v5
179229
with:
180-
python-version: ${{ inputs.python-version }}
230+
python-version: ${{ matrix.PY_VER }}
181231

182232
- name: Set up mini CTK
183-
if: ${{ inputs.local-ctk == '1' }}
233+
if: ${{ matrix.LOCAL_CTK == '1' }}
184234
uses: ./.github/actions/fetch_ctk
185235
continue-on-error: false
186236
with:
187237
host-platform: ${{ inputs.host-platform }}
188-
cuda-version: ${{ inputs.cuda-version }}
238+
cuda-version: ${{ matrix.CUDA_VER }}
189239

190240
- name: Run cuda.bindings tests
191241
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
192242
run: |
193243
Push-Location $env:CUDA_BINDINGS_ARTIFACTS_DIR
194-
if ('${{ inputs.local-ctk }}' -eq '1') {
244+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
195245
Get-ChildItem $env:CUDA_PATH
196246
echo $PATH
197247
pip install (Get-ChildItem -Filter *.whl).FullName
@@ -212,14 +262,14 @@ jobs:
212262
# If mismatch: cuda.bindings is installed from the backport branch.
213263
if ($env:SKIP_CUDA_BINDINGS_TEST -eq '1') {
214264
Push-Location $env:CUDA_BINDINGS_ARTIFACTS_DIR
215-
if ('${{ inputs.local-ctk }}' -eq '1') {
265+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
216266
pip install (Get-ChildItem -Filter *.whl).FullName
217267
} else {
218268
pip install "$((Get-ChildItem -Filter *.whl).FullName)[all]"
219269
}
220270
Pop-Location
221271
}
222-
$TEST_CUDA_MAJOR = '${{ inputs.cuda-version }}' -split '\.' | Select-Object -First 1
272+
$TEST_CUDA_MAJOR = '${{ matrix.CUDA_VER }}' -split '\.' | Select-Object -First 1
223273
Push-Location $env:CUDA_CORE_ARTIFACTS_DIR
224274
pip install "$((Get-ChildItem -Filter *.whl).FullName)[cu${TEST_CUDA_MAJOR}]"
225275
Pop-Location
@@ -231,7 +281,7 @@ jobs:
231281
232282
- name: Ensure cuda-python installable
233283
run: |
234-
if ('${{ inputs.local-ctk }}' -eq '1') {
284+
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
235285
pip install (Get-ChildItem -Filter cuda_python*.whl).FullName
236286
} else {
237287
pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"

0 commit comments

Comments
 (0)