Skip to content

Commit 70aa3a9

Browse files
cpcloudclaude
andcommitted
CI: Test sdist builds for all user-facing packages
Add a new test-sdist workflow that builds an sdist and then a wheel-from-sdist for each of the 4 user-facing packages (cuda_pathfinder, cuda_python, cuda_bindings, cuda_core). This catches regressions in MANIFEST.in or package-data configuration that could silently break sdist-based builds. Closes #1599 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 82e6bb8 commit 70aa3a9

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ jobs:
133133
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
134134
prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }}
135135

136+
test-sdist:
137+
needs:
138+
- ci-vars
139+
- should-skip
140+
name: Test sdist
141+
if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }}
142+
secrets: inherit
143+
uses: ./.github/workflows/test-sdist.yml
144+
with:
145+
host-platform: linux-64
146+
cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
147+
136148
# NOTE: Test jobs are split by platform for the same reason as build jobs (see
137149
# build-linux-64). Keep these job definitions textually identical except for:
138150
# - host-platform value
@@ -228,6 +240,7 @@ jobs:
228240
runs-on: ubuntu-latest
229241
needs:
230242
- should-skip
243+
- test-sdist
231244
- test-linux-64
232245
- test-linux-aarch64
233246
- test-windows
@@ -258,6 +271,9 @@ jobs:
258271
if ${{ needs.doc.result == 'cancelled' || needs.doc.result == 'failure' }}; then
259272
exit 1
260273
fi
274+
if ${{ needs.test-sdist.result == 'cancelled' || needs.test-sdist.result == 'failure' }}; then
275+
exit 1
276+
fi
261277
if [[ "${doc_only}" != "true" ]]; then
262278
if ${{ needs.test-linux-64.result == 'cancelled' ||
263279
needs.test-linux-64.result == 'failure' ||

.github/workflows/test-sdist.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
host-platform:
9+
required: true
10+
type: string
11+
cuda-version:
12+
required: true
13+
type: string
14+
15+
defaults:
16+
run:
17+
shell: bash --noprofile --norc -xeuo pipefail {0}
18+
19+
permissions:
20+
contents: read # This is required for actions/checkout
21+
22+
jobs:
23+
test-sdist:
24+
name: Test sdist builds
25+
runs-on: linux-amd64-cpu8
26+
steps:
27+
- name: Checkout ${{ github.event.repository.name }}
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
34+
with:
35+
python-version: "3.12"
36+
37+
- name: Install build tools
38+
run: pip install build
39+
40+
# Pure Python packages -- no CTK needed.
41+
- name: Build cuda.pathfinder sdist and wheel-from-sdist
42+
run: |
43+
python -m build --sdist cuda_pathfinder/
44+
pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz
45+
46+
- name: Build cuda-python sdist and wheel-from-sdist
47+
run: |
48+
python -m build --sdist cuda_python/
49+
pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz
50+
51+
# Cython packages need CTK + sccache.
52+
# The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN
53+
# are exposed by this action.
54+
- name: Enable sccache
55+
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # 0.0.9
56+
with:
57+
disable_annotations: 'true'
58+
59+
# xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867
60+
- name: Adding additional GHA cache-related env vars
61+
uses: actions/github-script@v8
62+
with:
63+
script: |
64+
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
65+
core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL'])
66+
67+
- name: Setup proxy cache
68+
uses: nv-gha-runners/setup-proxy-cache@main
69+
continue-on-error: true
70+
with:
71+
enable-apt: true
72+
73+
- name: Set up mini CTK
74+
uses: ./.github/actions/fetch_ctk
75+
continue-on-error: false
76+
with:
77+
host-platform: ${{ inputs.host-platform }}
78+
cuda-version: ${{ inputs.cuda-version }}
79+
80+
# cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH
81+
# (set by fetch_ctk) must be available for both sdist and wheel builds.
82+
- name: Build cuda.bindings sdist and wheel-from-sdist
83+
run: |
84+
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
85+
export CC="sccache cc"
86+
export CXX="sccache c++"
87+
python -m build --sdist cuda_bindings/
88+
pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz
89+
90+
# cuda_core sdist delegates to setuptools (no CTK needed), but
91+
# wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via
92+
# get_requires_for_build_wheel in build_hooks.py).
93+
- name: Build cuda.core sdist and wheel-from-sdist
94+
run: |
95+
export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)
96+
export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)"
97+
export CC="sccache cc"
98+
export CXX="sccache c++"
99+
export PIP_FIND_LINKS="$(pwd)/cuda_bindings/dist $(pwd)/cuda_pathfinder/dist"
100+
python -m build --sdist cuda_core/
101+
pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz
102+
103+
- name: Show sccache stats
104+
if: always()
105+
run: sccache --show-stats

0 commit comments

Comments
 (0)