Skip to content

Commit 4f0e8bd

Browse files
committed
separate test matrix from build matrix and expand it
1 parent 243a46f commit 4f0e8bd

File tree

2 files changed

+62
-58
lines changed

2 files changed

+62
-58
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: 62 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
on:
22
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
133

144
jobs:
155
build:
16-
name: Build (${{ inputs.host-platform }}, Python "${{ inputs.python-version }}")
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
# TODO: align host-platform names with conda convention
10+
host-platform:
11+
- linux-x64
12+
- linux-aarch64
13+
- win-x64
14+
python-version:
15+
- "3.13"
16+
- "3.12"
17+
- "3.11"
18+
- "3.10"
19+
- "3.9"
20+
cuda-version:
21+
# Note: this is for build-time only; the test-time matrix needs to be
22+
# defined separately.
23+
- "12.6.2"
24+
name: Build (${{ matrix.host-platform }}, Python "${{ matrix.python-version }}")
1725
if: ${{ github.repository_owner == 'nvidia' }}
1826
permissions:
1927
id-token: write # This is required for configure-aws-credentials
2028
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') }}
29+
runs-on: ${{ (matrix.host-platform == 'linux-x64' && 'linux-amd64-cpu8') ||
30+
(matrix.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
31+
(matrix.host-platform == 'win-x64' && 'windows-2019') }}
32+
# (matrix.host-platform == 'win-x64' && 'windows-amd64-cpu8') }}
2533
outputs:
2634
CUDA_CORE_ARTIFACT_NAME: ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACT_NAME }}
2735
CUDA_CORE_ARTIFACTS_DIR: ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACTS_DIR }}
@@ -35,34 +43,34 @@ jobs:
3543

3644
# WAR: setup-python is not relocatable...
3745
# see https://github.com/actions/setup-python/issues/871
38-
- name: Set up Python ${{ inputs.python-version }}
39-
if: ${{ startsWith(inputs.host-platform, 'linux') }}
46+
- name: Set up Python ${{ matrix.python-version }}
47+
if: ${{ startsWith(matrix.host-platform, 'linux') }}
4048
id: setup-python
4149
uses: actions/setup-python@v5
4250
with:
4351
python-version: "3.12"
4452

4553
- name: Set up MSVC
46-
if: ${{ startsWith(inputs.host-platform, 'win') }}
54+
if: ${{ startsWith(matrix.host-platform, 'win') }}
4755
uses: ilammy/msvc-dev-cmd@v1
4856

4957
- name: Set environment variables
5058
shell: bash --noprofile --norc -xeuo pipefail {0}
5159
run: |
52-
PYTHON_VERSION_FORMATTED=$(echo '${{ inputs.python-version }}' | tr -d '.')
53-
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
60+
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
61+
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
5462
CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-manylinux*"
5563
REPO_DIR=$(pwd)
56-
elif [[ "${{ inputs.host-platform }}" == win* ]]; then
64+
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
5765
CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-win_amd64"
5866
PWD=$(pwd)
5967
REPO_DIR=$(cygpath -w $PWD)
6068
fi
6169
6270
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
71+
echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
6472
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
73+
echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ matrix.cuda-version }}-${{ matrix.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
6674
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
6775
echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV
6876

@@ -84,7 +92,7 @@ jobs:
8492
- name: List the cuda.core artifacts directory
8593
shell: bash --noprofile --norc -xeuo pipefail {0}
8694
run: |
87-
if [[ "${{ inputs.host-platform }}" == win* ]]; then
95+
if [[ "${{ matrix.host-platform }}" == win* ]]; then
8896
export CHOWN=chown
8997
else
9098
export CHOWN="sudo chown"
@@ -110,8 +118,8 @@ jobs:
110118
uses: ./.github/actions/fetch_ctk
111119
continue-on-error: false
112120
with:
113-
host-platform: ${{ inputs.host-platform }}
114-
cuda-version: ${{ inputs.cuda-version }}
121+
host-platform: ${{ matrix.host-platform }}
122+
cuda-version: ${{ matrix.cuda-version }}
115123
fail-on-ctk-cache-miss: false
116124

117125
- name: Build cuda.bindings wheel
@@ -134,7 +142,7 @@ jobs:
134142
- name: List the cuda.bindings artifacts directory
135143
shell: bash --noprofile --norc -xeuo pipefail {0}
136144
run: |
137-
if [[ "${{ inputs.host-platform }}" == win* ]]; then
145+
if [[ "${{ matrix.host-platform }}" == win* ]]; then
138146
export CHOWN=chown
139147
else
140148
export CHOWN="sudo chown"
@@ -165,16 +173,34 @@ jobs:
165173
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${CUDA_BINDINGS_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
166174
167175
test:
168-
# TODO: improve the name once a separate test matrix is defined
169-
name: Test (CUDA ${{ inputs.cuda-version }})
176+
strategy:
177+
fail-fast: false
178+
matrix:
179+
# TODO: align host-platform names with conda convention
180+
host-platform:
181+
- linux-x64
182+
- linux-aarch64
183+
- win-x64
184+
python-version:
185+
- "3.13"
186+
- "3.12"
187+
- "3.11"
188+
- "3.10"
189+
- "3.9"
190+
cuda-version:
191+
# Note: this is for test-time only.
192+
- "12.6.2"
193+
- "12.0.1"
194+
- "11.8.0"
195+
name: Test (${{ matrix.host-platform }}, CUDA ${{ matrix.cuda-version }}, Python "${{ matrix.python-version }}")
170196
# TODO: enable testing once win-64 GPU runners are up
171197
if: ${{ (github.repository_owner == 'nvidia') &&
172-
startsWith(inputs.host-platform, 'linux') }}
198+
startsWith(matrix.host-platform, 'linux') }}
173199
permissions:
174200
id-token: write # This is required for configure-aws-credentials
175201
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') }}
202+
runs-on: ${{ (matrix.host-platform == 'linux-x64' && 'linux-amd64-gpu-v100-latest-1') ||
203+
(matrix.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-a100-latest-1') }}
178204
# Our self-hosted runners require a container
179205
# TODO: use a different (nvidia?) container
180206
container:
@@ -227,10 +253,10 @@ jobs:
227253
pwd
228254
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
229255
230-
- name: Set up Python ${{ inputs.python-version }}
256+
- name: Set up Python ${{ matrix.python-version }}
231257
uses: actions/setup-python@v5
232258
with:
233-
python-version: ${{ inputs.python-version }}
259+
python-version: ${{ matrix.python-version }}
234260

235261
# The cache action needs this
236262
- name: Install zstd
@@ -243,8 +269,8 @@ jobs:
243269
uses: ./.github/actions/fetch_ctk
244270
continue-on-error: false
245271
with:
246-
host-platform: ${{ inputs.host-platform }}
247-
cuda-version: ${{ inputs.cuda-version }}
272+
host-platform: ${{ matrix.host-platform }}
273+
cuda-version: ${{ matrix.cuda-version }}
248274
fail-on-ctk-cache-miss: true
249275

250276
- name: Run test / analysis

0 commit comments

Comments
 (0)