CI: shrink checkouts via shallow / treeless partial clones#2177
Conversation
Of the 15 workflow checkouts that used fetch-depth: 0, only 7 actually need the commit graph (setuptools-scm, git merge-base, git worktree), and none of them need historical blobs. The remaining 8 either do no git operations or only need tag resolution. - 6 sites with no local git ops: fetch-depth: 1 (ci.yml ci-vars, build-docs.yml, release-upload.yml, release.yml check-tag, release-cuda-pathfinder.yml upload-assets, coverage.yml coverage-windows) - 2 sites that resolve a tag to a SHA via lookup-run-id: fetch-depth: 1 + fetch-tags: true (release.yml determine-run-id, release-cuda-pathfinder.yml prepare) - 7 sites that need the commit graph but not blobs: fetch-depth: 0 + filter: blob:none (build-wheel.yml, ci.yml detect-changes, cleanup-pr-previews.yml, coverage.yml coverage-linux, coverage.yml build-wheel-windows, test-sdist-linux.yml, test-sdist-windows.yml) Closes NVIDIA#2091
|
/ok to test e673fe1 |
|
|
CI is fully green, and the checkout-step speedup is significant. Sampling representative jobs from this PR's run (
Every checkout is now seconds rather than minutes. Cumulative compute time saved per CI run across the full matrix (6 linux-64 + 6 linux-aarch64 + 6 win-64 builds, 2 sdist jobs, No correctness issues observed: -- Leo's bot |
Summary
Closes #2091.
15 workflow checkouts used
fetch-depth: 0(full clone with every blob in history). The audit in #2091 showed only 7 actually need the commit graph (setuptools-scm,git merge-base,git worktree), and none need historical blobs. The remaining 8 either do no local git operations or only need tag resolution. This PR applies the three patterns from that audit.Patterns applied
Plain shallow clone —
fetch-depth: 1(6 sites, no local git ops)ci.ymlci-varsbuild-docs.ymlrelease-upload.ymlrelease.ymlcheck-tagrelease-cuda-pathfinder.ymlupload-assetscoverage.ymlcoverage-windowsShallow + tags —
fetch-depth: 1+fetch-tags: true(2 sites,lookup-run-iddoesgit rev-parse <tag>)release.ymldetermine-run-idrelease-cuda-pathfinder.ymlprepareTreeless —
fetch-depth: 0+filter: blob:none(7 sites, commit graph needed but not historical blobs)build-wheel.yml(setuptools-scm)ci.ymldetect-changes (git merge-base+git diff --name-only)cleanup-pr-previews.yml(git worktree add gh-pages)coverage.ymlcoverage-linux (setuptools-scm)coverage.ymlbuild-wheel-windows (setuptools-scm)test-sdist-linux.yml(python -m build→ setuptools-scm)test-sdist-windows.yml(same)Should noticeably reduce checkout time, especially on Windows where git operations are slower.
Test plan
release.ymlandrelease-cuda-pathfinder.ymlpaths (these aren't triggered by PR CI)-- Leo's bot