Skip to content

Commit f0288bd

Browse files
committed
test cuda.core optional dep logic; install cupy in CI
1 parent 8ee415d commit f0288bd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ jobs:
182182
# Note: this is for test-time only.
183183
- "12.6.2"
184184
- "12.0.1"
185-
# FIXME: cannot run cuda.bindings 12.x with CTK 11.x
186185
- "11.8.0"
187186
runner:
188187
- default
@@ -232,7 +231,7 @@ jobs:
232231
233232
BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ needs.build.outputs.BUILD_CTK_VER }})"
234233
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.cuda-version }})"
235-
if [[ $BUILD_CUDA_MAJOR -gt $TEST_CUDA_MAJOR ]]; then
234+
if [[ $BUILD_CUDA_MAJOR != $TEST_CUDA_MAJOR ]]; then
236235
SKIP_CUDA_BINDINGS_TEST=1
237236
else
238237
SKIP_CUDA_BINDINGS_TEST=0
@@ -306,18 +305,18 @@ jobs:
306305
if [[ ${{ matrix.python-version }} == "3.13" ]]; then
307306
echo "Python 3.13 + cuda-python ${{ matrix.cuda-version }} is not supported, skipping the test..."
308307
exit 0
309-
else
310-
pip install "cuda-python==$(cut -d '.' -f 1,2 <<< ${{ matrix.cuda-version }}).*"
311308
fi
312309
fi
313310
311+
# If build/test majors match: cuda.bindings is installed in the previous step.
312+
# If mismatch: cuda.bindings is installed from PyPI.
313+
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ matrix.cuda-version }})"
314314
pushd "${CUDA_CORE_ARTIFACTS_DIR}"
315-
pip install *.whl
315+
pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}"]
316316
popd
317317
318318
pushd ./cuda_core
319319
# TODO: add requirements.txt for test deps?
320-
# TODO: add cupy as an optional test dep?
321-
pip install pytest
320+
pip install pytest "cupy-cuda${TEST_CUDA_MAJOR}x"
322321
pytest -rxXs tests/
323322
popd

0 commit comments

Comments
 (0)