ci: speed up slow test workflows#5532
Conversation
📝 WalkthroughWalkthroughThis PR updates GitHub Actions CI workflows and a local test script with three improvements: replacing pip-based uv installation with the official setup-uv action across all Python test workflows, enabling parallel C++ test execution via a configurable environment variable, and filtering out experimental tests from the CUDA test suite. ChangesCI and Test Execution
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/test_cc.yml:
- Line 45: Replace the floating tag for astral-sh/setup-uv with a pinned full
commit SHA in both places; specifically, in .github/workflows/test_cc.yml (lines
45-45) change `uses: astral-sh/setup-uv@v7` to `uses:
astral-sh/setup-uv@<FULL_COMMIT_SHA>` and in .github/workflows/test_python.yml
(lines 30-30) make the identical change using the same <FULL_COMMIT_SHA> value
so both workflows reference the same immutable commit SHA.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0205eee2-f401-4a7d-b514-22b5ab8755d7
📒 Files selected for processing (4)
.github/workflows/test_cc.yml.github/workflows/test_cuda.yml.github/workflows/test_python.ymlsource/install/test_cc_local.sh
| - uses: lukka/get-cmake@latest | ||
| - run: python -m pip install uv | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate all workflows that use astral-sh/setup-uv
rg -n --hidden --glob '.github/workflows/*' 'uses:\s*astral-sh/setup-uv@' .github/workflows || true
# Print the surrounding lines for each match (to capture the exact ref)
rg -n --hidden --glob '.github/workflows/*' -U 'uses:\s*astral-sh/setup-uv@' .github/workflows \
| sed -E 's/^([^:]+):([0-9]+):.*/\1:\2/' \
| sort -u \
| while IFS=: read -r file line; do
echo "---- $file:$line ----"
# Show ~3 lines around the usage
nl -ba "$file" | awk -v L="$line" 'NR>=L-3 && NR<=L+3 {print}'
doneRepository: deepmodeling/deepmd-kit
Length of output: 407
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# List all usages of the setup-uv action across workflows
rg -n --hidden --glob '.github/workflows/*' 'uses:\s*astral-sh/setup-uv@' .github/workflows
echo
echo "=== References (unique) ==="
rg --hidden --glob '.github/workflows/*' 'uses:\s*astral-sh/setup-uv@' .github/workflows \
| sed -E 's/^.*uses:\s*//' \
| sort -uRepository: deepmodeling/deepmd-kit
Length of output: 341
Pin astral-sh/setup-uv to an immutable commit SHA (avoid @v7)
Unpinned uses: references create a shared supply-chain risk across workflows.
.github/workflows/test_cc.yml#L45:uses: astral-sh/setup-uv@v7.github/workflows/test_python.yml#L30:uses: astral-sh/setup-uv@v7.github/workflows/copilot-setup-steps.yml#L41:uses: astral-sh/setup-uv@v7
Pin astral-sh/setup-uv to a full commit SHA (and use the same SHA across all workflows).
🧰 Tools
🪛 zizmor (1.25.2)
[error] 45-45: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
📍 Affects 2 files
.github/workflows/test_cc.yml#L45-L45(this comment).github/workflows/test_python.yml#L30-L30
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/test_cc.yml at line 45, Replace the floating tag for
astral-sh/setup-uv with a pinned full commit SHA in both places; specifically,
in .github/workflows/test_cc.yml (lines 45-45) change `uses:
astral-sh/setup-uv@v7` to `uses: astral-sh/setup-uv@<FULL_COMMIT_SHA>` and in
.github/workflows/test_python.yml (lines 30-30) make the identical change using
the same <FULL_COMMIT_SHA> value so both workflows reference the same immutable
commit SHA.
Source: Linters/SAST tools
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5532 +/- ##
==========================================
- Coverage 82.19% 82.19% -0.01%
==========================================
Files 891 891
Lines 101599 101599
Branches 4242 4242
==========================================
- Hits 83507 83506 -1
Misses 16789 16789
- Partials 1303 1304 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This PR is drafted by codex and I think it's meaningless. |
Summary
astral-sh/setup-uv.source/tests/pt_exptin the CUDA Python job; these PyTorch export/compile tests are already covered by the CPU Python workflow and dominate Python test time.test_cc_local.shto run ctest entries in parallel whenCTEST_PARALLEL_LEVELis set, and enable 3-way ctest parallelism in the C++ workflow.Motivation
Recent CI timings show the CUDA workflow is dominated by
python -m pytest source/tests:27417297979: total CUDA job ~4h15m; Python pytest ~3h02m; C++ step ~47m; LAMMPS/i-PI ~15m.27417297836:source/tests/pt_exptaccounts for ~18,299s of 34,345s cumulative recorded Python 3.13 test duration.27417297837: TF/PT C++ matrix entries take ~47m, while the Paddle-only entries finish in ~7m.Validation
pythonYAML parse for changed workflowsbash -n source/install/test_cc_local.shgit diff --checkruff check .ruff format --check .git commitpassed for changed filesSummary by CodeRabbit