Skip to content

Commit 64e8fab

Browse files
committed
Test against CUDA wheels
1 parent bf4ab09 commit 64e8fab

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

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

+24-12
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,17 @@ jobs:
158158
cuda-version:
159159
# Note: this is for test-time only.
160160
- "11.8.0"
161+
local-ctk:
162+
- 1 # use mini CTK
163+
- 0 # use CTK wheels
161164
runner:
162165
- default
163166
include:
164167
- host-platform: linux-64
165168
python-version: "3.12"
166169
cuda-version: "11.8.0"
167170
runner: H100
168-
name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }})
171+
name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }})
169172
# The build stage could fail but we want the CI to keep moving.
170173
if: ${{ github.repository_owner == 'nvidia' && always() }}
171174
permissions:
@@ -239,6 +242,7 @@ jobs:
239242
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
240243

241244
- name: Set up mini CTK
245+
if: ${{ matrix.local-ctk == '1' }}
242246
uses: ./.github/actions/fetch_ctk
243247
continue-on-error: false
244248
with:
@@ -249,22 +253,30 @@ jobs:
249253
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
250254
shell: bash --noprofile --norc -xeuo pipefail {0}
251255
run: |
252-
ls $CUDA_PATH
253-
254256
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
255257
pip install *.whl
258+
if [[ "${{ matrix.local-ctk }}" == 1 ]]; then
259+
ls $CUDA_PATH
260+
pip install *.whl
261+
else
262+
pip install $(ls *.whl)[all]
263+
fi
256264
popd
257265
258266
pushd ./cuda_bindings
259267
pip install -r requirements.txt
260268
pytest -rxXs tests/
261-
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
262-
# cython tests require gcc
263-
apt install -y build-essential
264-
bash tests_cython/build_tests.sh
265-
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
266-
# TODO: enable this once win-64 runners are up
267-
exit 1
268-
fi
269-
pytest -rxXs tests_cython
269+
# It is a bit convoluted to run the Cython tests against CTK wheels,
270+
# so let's just skip them.
271+
if [[ "${{ matrix.local-ctk }}" == 1 ]]; then
272+
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
273+
# cython tests require gcc
274+
apt install -y build-essential
275+
bash tests_cython/build_tests.sh
276+
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
277+
# TODO: enable this once win-64 runners are up
278+
exit 1
279+
fi
280+
pytest -rxXs tests_cython
281+
fi
270282
popd

0 commit comments

Comments
 (0)