Skip to content

Commit 233447b

Browse files
committed
Harden test workflows with intentional shallow clone and version checks
Use an intentionally shallow clone (fetch-depth: 1) to test wheel installation without full git history. This ensures we're testing the wheel artifacts themselves, not building from source. Changes: - Set fetch-depth: 1 explicitly (although it is the default) with comment emphasizing that shallow cloning is intentional - Add --only-binary=:all: to cuda-python installation to ensure we only test wheels, never build from source - Add "Verify installed package versions" step that imports cuda.pathfinder and cuda.bindings to trigger __version__ assertions immediately after installation, providing early detection of invalid versions - Update comments to accurately reflect that we're testing wheel artifacts This approach hardens the test workflows by: - Making the shallow clone intentional and explicit - Actually testing that __version__ assertions work (fail-fast on invalid versions) - Catching version issues immediately after installation, before tests run - Ensuring we only test wheels, not source builds Applied consistently to both: - .github/workflows/test-wheel-windows.yml - .github/workflows/test-wheel-linux.yml
1 parent a1584a2 commit 233447b

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/test-wheel-linux.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
steps:
3838
- name: Checkout ${{ github.event.repository.name }}
3939
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
40+
with:
41+
fetch-depth: 1 # Intentionally shallow clone to test wheel installation without full git history
4042

4143
- name: Validate Test Type
4244
run: |
@@ -94,6 +96,8 @@ jobs:
9496

9597
- name: Checkout ${{ github.event.repository.name }}
9698
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
99+
with:
100+
fetch-depth: 1 # Intentionally shallow clone to test wheel installation without full git history
97101

98102
- name: Setup proxy cache
99103
uses: nv-gha-runners/setup-proxy-cache@main
@@ -269,17 +273,22 @@ jobs:
269273
- name: Ensure cuda-python installable
270274
run: |
271275
if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then
272-
pip install cuda_python*.whl
276+
pip install --only-binary=:all: cuda_python*.whl
273277
else
274-
pip install $(ls cuda_python*.whl)[all]
278+
pip install --only-binary=:all: $(ls cuda_python*.whl)[all]
275279
fi
276280
281+
- name: Verify installed package versions
282+
run: |
283+
# Trigger __version__ assertions to guard against setuptools-scm fallback versions
284+
python -c 'import cuda.pathfinder'
285+
python -c 'import cuda.bindings'
286+
277287
- name: Install cuda.pathfinder extra wheels for testing
278288
run: |
279289
set -euo pipefail
280290
pushd cuda_pathfinder
281-
# Install pathfinder from the pre-built wheel, since building from
282-
# source won't work in this context (we don't have a git checkout).
291+
# Install pathfinder from the pre-built wheel to test the wheel artifacts
283292
pip install --only-binary=:all: -v ./*.whl --group "test-cu${TEST_CUDA_MAJOR}"
284293
pip list
285294
popd

.github/workflows/test-wheel-windows.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
steps:
3535
- name: Checkout ${{ github.event.repository.name }}
3636
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
37+
with:
38+
fetch-depth: 1 # Intentionally shallow clone to test wheel installation without full git history
3739

3840
- name: Validate Test Type
3941
run: |
@@ -70,6 +72,8 @@ jobs:
7072
steps:
7173
- name: Checkout ${{ github.event.repository.name }}
7274
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
75+
with:
76+
fetch-depth: 1 # Intentionally shallow clone to test wheel installation without full git history
7377

7478
- name: Setup proxy cache
7579
uses: nv-gha-runners/setup-proxy-cache@main
@@ -236,11 +240,18 @@ jobs:
236240
- name: Ensure cuda-python installable
237241
run: |
238242
if ('${{ matrix.LOCAL_CTK }}' -eq '1') {
239-
pip install (Get-ChildItem -Filter cuda_python*.whl).FullName
243+
pip install --only-binary=:all: (Get-ChildItem -Filter cuda_python*.whl).FullName
240244
} else {
241-
pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
245+
pip install --only-binary=:all: "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
242246
}
243247
248+
- name: Verify installed package versions
249+
shell: bash --noprofile --norc -xeuo pipefail {0}
250+
run: |
251+
# Trigger __version__ assertions to guard against setuptools-scm fallback versions
252+
python -c 'import cuda.pathfinder'
253+
python -c 'import cuda.bindings'
254+
244255
- name: Install cuda.pathfinder extra wheels for testing
245256
shell: bash --noprofile --norc -xeuo pipefail {0}
246257
run: |

0 commit comments

Comments
 (0)