1
- name : " CI: Test against local CTK "
1
+ name : " CI: Test wheels "
2
2
3
3
on :
4
4
workflow_call :
9
9
python-version :
10
10
type : string
11
11
required : true
12
- build_ctk_ver :
12
+ build-ctk-ver :
13
13
type : string
14
14
required : true
15
15
cuda-version :
16
16
type : string
17
17
required : true
18
+ local-ctk :
19
+ type : string
20
+ required : true
18
21
runner :
19
22
type : string
20
23
required : true
55
58
REPO_DIR=$(cygpath -w $PWD)
56
59
fi
57
60
58
- BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.build_ctk_ver }})"
61
+ BUILD_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.build-ctk-ver }})"
59
62
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
60
63
if [[ $BUILD_CUDA_MAJOR != $TEST_CUDA_MAJOR ]]; then
61
64
SKIP_CUDA_BINDINGS_TEST=1
69
72
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
70
73
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
71
74
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
72
- CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build_ctk_ver }}-${{ inputs.host-platform }}"
75
+ CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-${{ inputs.host-platform }}"
73
76
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
74
77
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
75
78
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
@@ -138,6 +141,7 @@ jobs:
138
141
AGENT_TOOLSDIRECTORY : " /opt/hostedtoolcache"
139
142
140
143
- name : Set up mini CTK
144
+ if : ${{ inputs.local-ctk == '1' }}
141
145
uses : ./.github/actions/fetch_ctk
142
146
continue-on-error : false
143
147
with :
@@ -147,31 +151,43 @@ jobs:
147
151
- name : Run cuda.bindings tests
148
152
if : ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
149
153
run : |
150
- ls $CUDA_PATH
151
-
152
154
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
153
- pip install *.whl
155
+ if [[ "${{ inputs.local-ctk }}" == 1 ]]; then
156
+ ls $CUDA_PATH
157
+ pip install *.whl
158
+ else
159
+ pip install $(ls *.whl)[all]
160
+ fi
154
161
popd
155
162
156
163
pushd ./cuda_bindings
157
164
pip install -r requirements.txt
158
165
pytest -rxXs tests/
159
- if [[ "${{ inputs.host-platform }}" == linux* ]]; then
160
- bash tests/cython/build_tests.sh
161
- elif [[ "${{ inputs.host-platform }}" == win* ]]; then
162
- # TODO: enable this once win-64 runners are up
163
- exit 1
164
- fi
165
- pytest -rxXs tests/cython
166
- popd
166
+
167
+ # It is a bit convoluted to run the Cython tests against CTK wheels,
168
+ # so let's just skip them.
169
+ if [[ "${{ inputs.local-ctk }}" == 1 ]]; then
170
+ if [[ "${{ inputs.host-platform }}" == linux* ]]; then
171
+ bash tests/cython/build_tests.sh
172
+ elif [[ "${{ inputs.host-platform }}" == win* ]]; then
173
+ # TODO: enable this once win-64 runners are up
174
+ exit 1
175
+ fi
176
+ pytest -rxXs tests/cython
177
+ popd
178
+ fi
167
179
168
180
- name : Run cuda.core tests
169
181
run : |
170
182
# If build/test majors match: cuda.bindings is installed in the previous step.
171
183
# If mismatch: cuda.bindings is installed from the backport branch.
172
184
if [[ "${SKIP_CUDA_BINDINGS_TEST}" == 1 ]]; then
173
185
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
174
- pip install *.whl
186
+ if [[ "${{ inputs.local-ctk }}" == 1 ]]; then
187
+ pip install *.whl
188
+ else
189
+ pip install $(ls *.whl)[all]
190
+ fi
175
191
popd
176
192
fi
177
193
TEST_CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
0 commit comments