Skip to content

Commit a13d6be

Browse files
committed
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 51bd98f commit a13d6be

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
@@ -146,5 +146,6 @@ runs:
146146
run: |
147147
CUDA_PATH=$(realpath "./cuda_toolkit")
148148
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
149+
echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV
149150
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
150151
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
@@ -234,6 +234,9 @@ jobs:
234234
uses: actions/setup-python@v5
235235
with:
236236
python-version: ${{ matrix.python-version }}
237+
env:
238+
# we use self-hosted runners on which setup-python behaves weirdly...
239+
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"
237240

238241
- name: Set up mini CTK
239242
uses: ./.github/actions/fetch_ctk
@@ -255,6 +258,13 @@ jobs:
255258
pushd ./cuda_bindings
256259
pip install -r requirements.txt
257260
pytest -rxXs tests/
258-
# TODO: enable cython tests
259-
#pytest tests/cython
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
260270
popd

0 commit comments

Comments
 (0)