Skip to content

Commit 478acff

Browse files
committed
separate test matrix from build matrix and expand it (retry)
1 parent 243a46f commit 478acff

File tree

2 files changed

+63
-62
lines changed

2 files changed

+63
-62
lines changed

.github/workflows/ci-gh.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,7 @@ on:
1212

1313
jobs:
1414
ci:
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
# TODO: align host-platform names with conda convention
19-
host-platform:
20-
- linux-x64
21-
- linux-aarch64
22-
- win-x64
23-
python-version:
24-
- "3.13"
25-
- "3.12"
26-
- "3.11"
27-
- "3.10"
28-
- "3.9"
29-
cuda-version:
30-
# Note: this is for build-time only; the test-time matrix needs to be
31-
# defined separately.
32-
- "12.6.2"
3315
name: "CI"
3416
uses:
3517
./.github/workflows/gh-build-and-test.yml
36-
with:
37-
host-platform: ${{ matrix.host-platform }}
38-
python-version: ${{ matrix.python-version }}
39-
cuda-version: ${{ matrix.cuda-version }}
4018
secrets: inherit

.github/workflows/gh-build-and-test.yml

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1-
on:
2-
workflow_call:
3-
inputs:
4-
host-platform:
5-
type: string
6-
required: true
7-
python-version:
8-
type: string
9-
required: true
10-
cuda-version:
11-
type: string
12-
required: true
1+
on: workflow_call
132

143
jobs:
154
build:
16-
name: Build (${{ inputs.host-platform }}, Python "${{ inputs.python-version }}")
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
# TODO: align host-platform names with conda convention
9+
host-platform:
10+
- linux-x64
11+
- linux-aarch64
12+
- win-x64
13+
python-version:
14+
- "3.13"
15+
- "3.12"
16+
- "3.11"
17+
- "3.10"
18+
- "3.9"
19+
cuda-version:
20+
# Note: this is for build-time only.
21+
- "12.6.2"
22+
name: Build (${{ matrix.host-platform }}, Python "${{ matrix.python-version }}")
1723
if: ${{ github.repository_owner == 'nvidia' }}
1824
permissions:
1925
id-token: write # This is required for configure-aws-credentials
2026
contents: read # This is required for actions/checkout
21-
runs-on: ${{ (inputs.host-platform == 'linux-x64' && 'linux-amd64-cpu8') ||
22-
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
23-
(inputs.host-platform == 'win-x64' && 'windows-2019') }}
24-
# (inputs.host-platform == 'win-x64' && 'windows-amd64-cpu8') }}
27+
runs-on: ${{ (matrix.host-platform == 'linux-x64' && 'linux-amd64-cpu8') ||
28+
(matrix.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
29+
(matrix.host-platform == 'win-x64' && 'windows-2019') }}
30+
# (matrix.host-platform == 'win-x64' && 'windows-amd64-cpu8') }}
2531
outputs:
2632
CUDA_CORE_ARTIFACT_NAME: ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACT_NAME }}
2733
CUDA_CORE_ARTIFACTS_DIR: ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACTS_DIR }}
@@ -35,34 +41,34 @@ jobs:
3541

3642
# WAR: setup-python is not relocatable...
3743
# see https://github.com/actions/setup-python/issues/871
38-
- name: Set up Python ${{ inputs.python-version }}
39-
if: ${{ startsWith(inputs.host-platform, 'linux') }}
44+
- name: Set up Python ${{ matrix.python-version }}
45+
if: ${{ startsWith(matrix.host-platform, 'linux') }}
4046
id: setup-python
4147
uses: actions/setup-python@v5
4248
with:
4349
python-version: "3.12"
4450

4551
- name: Set up MSVC
46-
if: ${{ startsWith(inputs.host-platform, 'win') }}
52+
if: ${{ startsWith(matrix.host-platform, 'win') }}
4753
uses: ilammy/msvc-dev-cmd@v1
4854

4955
- name: Set environment variables
5056
shell: bash --noprofile --norc -xeuo pipefail {0}
5157
run: |
52-
PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.')
53-
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
58+
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
59+
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
5460
CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-manylinux*"
5561
REPO_DIR=$(pwd)
56-
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
62+
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
5763
CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-win_amd64"
5864
PWD=$(pwd)
5965
REPO_DIR=$(cygpath -w $PWD)
6066
fi
6167
6268
echo "PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV
63-
echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ inputs.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
69+
echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
6470
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
65-
echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.cuda-version }}-${{ inputs.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
71+
echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ matrix.cuda-version }}-${{ matrix.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
6672
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
6773
echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV
6874

@@ -84,7 +90,7 @@ jobs:
8490
- name: List the cuda.core artifacts directory
8591
shell: bash --noprofile --norc -xeuo pipefail {0}
8692
run: |
87-
if [[ "${{ inputs.host-platform }}" == win* ]]; then
93+
if [[ "${{ matrix.host-platform }}" == win* ]]; then
8894
export CHOWN=chown
8995
else
9096
export CHOWN="sudo chown"
@@ -110,8 +116,8 @@ jobs:
110116
uses: ./.github/actions/fetch_ctk
111117
continue-on-error: false
112118
with:
113-
host-platform: ${{ inputs.host-platform }}
114-
cuda-version: ${{ inputs.cuda-version }}
119+
host-platform: ${{ matrix.host-platform }}
120+
cuda-version: ${{ matrix.cuda-version }}
115121
fail-on-ctk-cache-miss: false
116122

117123
- name: Build cuda.bindings wheel
@@ -134,7 +140,7 @@ jobs:
134140
- name: List the cuda.bindings artifacts directory
135141
shell: bash --noprofile --norc -xeuo pipefail {0}
136142
run: |
137-
if [[ "${{ inputs.host-platform }}" == win* ]]; then
143+
if [[ "${{ matrix.host-platform }}" == win* ]]; then
138144
export CHOWN=chown
139145
else
140146
export CHOWN="sudo chown"
@@ -165,16 +171,33 @@ jobs:
165171
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${CUDA_BINDINGS_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
166172
167173
test:
168-
# TODO: improve the name once a separate test matrix is defined
169-
name: Test (CUDA ${{ inputs.cuda-version }})
170-
# TODO: enable testing once win-64 GPU runners are up
171-
if: ${{ (github.repository_owner == 'nvidia') &&
172-
startsWith(inputs.host-platform, 'linux') }}
174+
strategy:
175+
fail-fast: false
176+
matrix:
177+
# TODO: align host-platform names with conda convention
178+
host-platform:
179+
- linux-x64
180+
- linux-aarch64
181+
# TODO: enable testing once win-64 GPU runners are up
182+
# - win-x64
183+
python-version:
184+
- "3.13"
185+
- "3.12"
186+
- "3.11"
187+
- "3.10"
188+
- "3.9"
189+
cuda-version:
190+
# Note: this is for test-time only.
191+
- "12.6.2"
192+
- "12.0.1"
193+
- "11.8.0"
194+
name: Test (${{ matrix.host-platform }}, CUDA ${{ matrix.cuda-version }}, Python "${{ matrix.python-version }}")
195+
if: ${{ (github.repository_owner == 'nvidia') }}
173196
permissions:
174197
id-token: write # This is required for configure-aws-credentials
175198
contents: read # This is required for actions/checkout
176-
runs-on: ${{ (inputs.host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
177-
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
199+
runs-on: ${{ (matrix.host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
200+
(matrix.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
178201
# Our self-hosted runners require a container
179202
# TODO: use a different (nvidia?) container
180203
container:
@@ -227,10 +250,10 @@ jobs:
227250
pwd
228251
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
229252
230-
- name: Set up Python ${{ inputs.python-version }}
253+
- name: Set up Python ${{ matrix.python-version }}
231254
uses: actions/setup-python@v5
232255
with:
233-
python-version: ${{ inputs.python-version }}
256+
python-version: ${{ matrix.python-version }}
234257

235258
# The cache action needs this
236259
- name: Install zstd
@@ -243,8 +266,8 @@ jobs:
243266
uses: ./.github/actions/fetch_ctk
244267
continue-on-error: false
245268
with:
246-
host-platform: ${{ inputs.host-platform }}
247-
cuda-version: ${{ inputs.cuda-version }}
269+
host-platform: ${{ matrix.host-platform }}
270+
cuda-version: ${{ matrix.cuda-version }}
248271
fail-on-ctk-cache-miss: true
249272

250273
- name: Run test / analysis

0 commit comments

Comments
 (0)