4242 # (matrix.host-platform == 'win-64' && 'windows-amd64-cpu8') }}
4343 outputs :
4444 BUILD_CTK_VER : ${{ steps.pass_env.outputs.CUDA_VERSION }}
45+ defaults :
46+ run :
47+ shell : bash --noprofile --norc -xeuo pipefail {0}
4548 steps :
4649 - name : Checkout ${{ github.event.repository.name }}
4750 uses : actions/checkout@v4
6366 uses : ilammy/msvc-dev-cmd@v1
6467
6568 - name : Set environment variables
66- shell : bash --noprofile --norc -xeuo pipefail {0}
6769 run : |
6870 PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
6971 if [[ "${{ matrix.host-platform }}" == linux* ]]; then
8183 echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV
8284
8385 - name : Dump environment
84- shell : bash --noprofile --norc -xeuo pipefail {0}
8586 run : |
8687 env
8788
@@ -110,7 +111,6 @@ jobs:
110111 output-dir : ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
111112
112113 - name : List the cuda.bindings artifacts directory
113- shell : bash --noprofile --norc -xeuo pipefail {0}
114114 run : |
115115 if [[ "${{ matrix.host-platform }}" == win* ]]; then
116116 export CHOWN=chown
@@ -122,8 +122,8 @@ jobs:
122122
123123 # TODO: enable this after NVIDIA/cuda-python#297 is resolved
124124 # - name: Check cuda.bindings wheel
125- # shell: bash --noprofile --norc -xeuo pipefail {0}
126125 # run: |
126+ # pip install twine
127127 # twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
128128
129129 - name : Upload cuda.bindings build artifacts
@@ -132,7 +132,36 @@ jobs:
132132 name : ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
133133 path : ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
134134 if-no-files-found : error
135- overwrite : ' true'
135+
136+ # upload-artifact's "overwrite: true" option has a race condition among parallel
137+ # jobs, so we let job 0 do the work
138+ - name : Build and check cuda-python wheel
139+ if : ${{ strategy.job-index == 0 }}
140+ run : |
141+ pushd cuda_python
142+ pip wheel -v --no-deps .
143+ pip install twine # TODO: remove me (see above)
144+ twine check *.whl
145+ popd
146+
147+ - name : List the cuda-python artifacts directory
148+ if : ${{ strategy.job-index == 0 }}
149+ run : |
150+ if [[ "${{ matrix.host-platform }}" == win* ]]; then
151+ export CHOWN=chown
152+ else
153+ export CHOWN="sudo chown"
154+ fi
155+ $CHOWN -R $(whoami) cuda_python/*.whl
156+ ls -lahR cuda_python
157+
158+ - name : Upload cuda-python build artifacts
159+ if : ${{ strategy.job-index == 0 }}
160+ uses : actions/upload-artifact@v4
161+ with :
162+ name : cuda-python-wheel
163+ path : cuda_python/*.whl
164+ if-no-files-found : error
136165
137166 - name : Pass environment variables to the next runner
138167 id : pass_env
@@ -186,9 +215,11 @@ jobs:
186215 NVIDIA_VISIBLE_DEVICES : ${{ env.NVIDIA_VISIBLE_DEVICES }}
187216 needs :
188217 - build
218+ defaults :
219+ run :
220+ shell : bash --noprofile --norc -xeuo pipefail {0}
189221 steps :
190222 - name : Ensure GPU is working
191- shell : bash --noprofile --norc -xeuo pipefail {0}
192223 run : nvidia-smi
193224
194225 - name : Checkout ${{ github.event.repository.name }}
@@ -198,7 +229,6 @@ jobs:
198229 ref : ${{ github.head_ref || github.ref_name }}
199230
200231 - name : Set environment variables
201- shell : bash --noprofile --norc -xeuo pipefail {0}
202232 run : |
203233 PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
204234 if [[ "${{ matrix.host-platform }}" == linux* ]]; then
@@ -221,14 +251,24 @@ jobs:
221251 echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
222252 echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $GITHUB_ENV
223253
254+ - name : Download cuda-python build artifacts
255+ uses : actions/download-artifact@v4
256+ with :
257+ name : cuda-python-wheel
258+ path : .
259+
260+ - name : Display structure of downloaded cuda-python artifacts
261+ run : |
262+ pwd
263+ ls -lahR .
264+
224265 - name : Download cuda.bindings build artifacts
225266 uses : actions/download-artifact@v4
226267 with :
227268 name : ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
228269 path : ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
229270
230271 - name : Display structure of downloaded cuda.bindings artifacts
231- shell : bash --noprofile --norc -xeuo pipefail {0}
232272 run : |
233273 pwd
234274 ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
@@ -251,7 +291,6 @@ jobs:
251291
252292 - name : Run cuda.bindings tests
253293 if : ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
254- shell : bash --noprofile --norc -xeuo pipefail {0}
255294 run : |
256295 pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
257296 if [[ "${{ matrix.local-ctk }}" == 1 ]]; then
@@ -280,6 +319,10 @@ jobs:
280319 fi
281320 popd
282321
322+ - name : Ensure cuda-python installable
323+ run : |
324+ pip install cuda_python*.whl
325+
283326 checks :
284327 name : Check job status
285328 permissions :
0 commit comments