Skip to content

Commit 7ffb964

Browse files
authored
Enable Cython tests for cuda.bindings (#323)
* enable Cython tests for cuda.bindings * build Cython test modules * Update gh-build-and-test.yml * Install system gcc * No sudo * also set CUDA_HOME * Try to find Python include * nit: add a skip condition and comments * simplify
1 parent aba2cd7 commit 7ffb964

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/actions/fetch_ctk/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,6 @@ runs:
145145
run: |
146146
CUDA_PATH=$(realpath "./cuda_toolkit")
147147
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
148+
echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV
148149
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
149150
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib" >> $GITHUB_ENV

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ jobs:
285285
uses: actions/setup-python@v5
286286
with:
287287
python-version: ${{ matrix.python-version }}
288+
env:
289+
# we use self-hosted runners on which setup-python behaves weirdly...
290+
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
288291

289292
- name: Set up mini CTK
290293
uses: ./.github/actions/fetch_ctk
@@ -306,8 +309,15 @@ jobs:
306309
pushd ./cuda_bindings
307310
pip install -r requirements.txt
308311
pytest -rxXs tests/
309-
# TODO: enable cython tests
310-
#pytest tests/cython
312+
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
313+
# cython tests require gcc
314+
apt install -y build-essential
315+
bash tests/cython/build_tests.sh
316+
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
317+
# TODO: enable this once win-64 runners are up
318+
exit 1
319+
fi
320+
pytest -rxXs tests/cython
311321
popd
312322
313323
- name: Run cuda.core tests

0 commit comments

Comments
 (0)