Skip to content

Commit

Permalink
Enable Cython tests for cuda.bindings (#323)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
leofang committed Jan 6, 2025
1 parent 51bd98f commit a13d6be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/actions/fetch_ctk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@ runs:
run: |
CUDA_PATH=$(realpath "./cuda_toolkit")
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib" >> $GITHUB_ENV
14 changes: 12 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
env:
# we use self-hosted runners on which setup-python behaves weirdly...
AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache"

- name: Set up mini CTK
uses: ./.github/actions/fetch_ctk
Expand All @@ -255,6 +258,13 @@ jobs:
pushd ./cuda_bindings
pip install -r requirements.txt
pytest -rxXs tests/
# TODO: enable cython tests
#pytest tests/cython
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
# cython tests require gcc
apt install -y build-essential
bash tests/cython/build_tests.sh
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
# TODO: enable this once win-64 runners are up
exit 1
fi
pytest -rxXs tests/cython
popd

0 comments on commit a13d6be

Please sign in to comment.