Skip to content

Commit 6be141f

Browse files
committed
update CI to build/test the meta wheel
1 parent 45b1bfd commit 6be141f

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

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

+46-12
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
# (matrix.host-platform == 'win-64' && 'windows-amd64-cpu8') }}
4343
outputs:
4444
BUILD_CTK_VER: ${{ steps.pass_env.outputs.CUDA_VERSION }}
45+
default:
46+
run:
47+
shell: bash --noprofile --norc -xeuo pipefail {0}
4548
steps:
4649
- name: Checkout ${{ github.event.repository.name }}
4750
uses: actions/checkout@v4
@@ -62,7 +65,6 @@ jobs:
6265
uses: ilammy/msvc-dev-cmd@v1
6366

6467
- name: Set environment variables
65-
shell: bash --noprofile --norc -xeuo pipefail {0}
6668
run: |
6769
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
6870
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
@@ -82,7 +84,6 @@ jobs:
8284
echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV
8385

8486
- name: Dump environment
85-
shell: bash --noprofile --norc -xeuo pipefail {0}
8687
run: |
8788
env
8889
@@ -97,7 +98,6 @@ jobs:
9798
output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
9899

99100
- name: List the cuda.core artifacts directory
100-
shell: bash --noprofile --norc -xeuo pipefail {0}
101101
run: |
102102
if [[ "${{ matrix.host-platform }}" == win* ]]; then
103103
export CHOWN=chown
@@ -108,7 +108,6 @@ jobs:
108108
ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
109109
110110
- name: Check cuda.core wheel
111-
shell: bash --noprofile --norc -xeuo pipefail {0}
112111
run: |
113112
pip install twine
114113
twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl
@@ -146,7 +145,6 @@ jobs:
146145
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
147146

148147
- name: List the cuda.bindings artifacts directory
149-
shell: bash --noprofile --norc -xeuo pipefail {0}
150148
run: |
151149
if [[ "${{ matrix.host-platform }}" == win* ]]; then
152150
export CHOWN=chown
@@ -158,7 +156,6 @@ jobs:
158156
159157
# TODO: enable this after NVIDIA/cuda-python#297 is resolved
160158
# - name: Check cuda.bindings wheel
161-
# shell: bash --noprofile --norc -xeuo pipefail {0}
162159
# run: |
163160
# twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl
164161

@@ -170,6 +167,31 @@ jobs:
170167
if-no-files-found: error
171168
overwrite: 'true'
172169

170+
- name: Build and check cuda-python wheel
171+
run: |
172+
pushd cuda_python
173+
pip wheel -v --no-deps .
174+
twine check *.whl
175+
popd
176+
177+
- name: List the cuda-python artifacts directory
178+
run: |
179+
if [[ "${{ matrix.host-platform }}" == win* ]]; then
180+
export CHOWN=chown
181+
else
182+
export CHOWN="sudo chown"
183+
fi
184+
$CHOWN -R $(whoami) cuda_python/*.whl
185+
ls -lahR cuda_python
186+
187+
- name: Upload cuda.bindings build artifacts
188+
uses: actions/upload-artifact@v4
189+
with:
190+
name: cuda-python-wheel
191+
path: cuda_python/*.whl
192+
if-no-files-found: error
193+
overwrite: 'true'
194+
173195
- name: Pass environment variables to the next runner
174196
id: pass_env
175197
run: |
@@ -221,9 +243,11 @@ jobs:
221243
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
222244
needs:
223245
- build
246+
default:
247+
run:
248+
shell: bash --noprofile --norc -xeuo pipefail {0}
224249
steps:
225250
- name: Ensure GPU is working
226-
shell: bash --noprofile --norc -xeuo pipefail {0}
227251
run: nvidia-smi
228252

229253
- name: Checkout ${{ github.event.repository.name }}
@@ -232,7 +256,6 @@ jobs:
232256
fetch-depth: 0
233257

234258
- name: Set environment variables
235-
shell: bash --noprofile --norc -xeuo pipefail {0}
236259
run: |
237260
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
238261
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
@@ -257,14 +280,24 @@ jobs:
257280
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
258281
echo "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $GITHUB_ENV
259282
283+
- name: Download cuda-python build artifacts
284+
uses: actions/download-artifact@v4
285+
with:
286+
name: cuda-python-wheel
287+
path: .
288+
289+
- name: Display structure of downloaded cuda-python artifacts
290+
run: |
291+
pwd
292+
ls -lahR .
293+
260294
- name: Download cuda.bindings build artifacts
261295
uses: actions/download-artifact@v4
262296
with:
263297
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
264298
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
265299

266300
- name: Display structure of downloaded cuda.bindings artifacts
267-
shell: bash --noprofile --norc -xeuo pipefail {0}
268301
run: |
269302
pwd
270303
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
@@ -276,7 +309,6 @@ jobs:
276309
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
277310

278311
- name: Display structure of downloaded cuda.core build artifacts
279-
shell: bash --noprofile --norc -xeuo pipefail {0}
280312
run: |
281313
pwd
282314
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
@@ -295,7 +327,6 @@ jobs:
295327

296328
- name: Run cuda.bindings tests
297329
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
298-
shell: bash --noprofile --norc -xeuo pipefail {0}
299330
run: |
300331
ls $CUDA_PATH
301332
@@ -311,7 +342,6 @@ jobs:
311342
popd
312343
313344
- name: Run cuda.core tests
314-
shell: bash --noprofile --norc -xeuo pipefail {0}
315345
run: |
316346
if [[ ${{ matrix.python-version }} == "3.13" ]]; then
317347
# TODO: remove this hack once cuda-python has a cp313 build
@@ -333,6 +363,10 @@ jobs:
333363
pytest -rxXs tests/
334364
popd
335365
366+
- name: Ensure cuda-python installable
367+
run: |
368+
pip install cuda_python*.whl
369+
336370
doc:
337371
name: Docs
338372
# The build stage could fail but we want the CI to keep moving.

0 commit comments

Comments
 (0)