ci: optimize test workflows — 32 jobs → 8 on PRs#4599
Open
ci: optimize test workflows — 32 jobs → 8 on PRs#4599
Conversation
- Restructure tests.yml: install once per Python version, share .venv via artifact instead of 32 independent installs - Reduce test groups from 8 to 4 (tests only take ~60s per group) - Only test Python 3.12+3.13 on PRs; full matrix on push to main - Switch all workflows from manual actions/cache to setup-uv built-in caching, eliminating cache race conditions - Add --frozen flag to uv sync for deterministic CI installs - Re-enable duration-based test splitting with least_duration algorithm (was disabled due to a bug in the path filter) - Fix update-test-durations path filter (tests/**/*.py never matched actual test dirs under lib/) - Add concurrency group with cancel-in-progress for PR runs - Add gate jobs to satisfy existing branch protection required checks
tar czf on the venv was taking too long (gzip is single-threaded). Simpler approach: each test job installs with setup-uv's built-in cache. With warm cache, uv sync --frozen takes ~10-15s which is faster than tar + upload + download + extract.
Run 3.10, 3.11, 3.12, 3.13 on every PR — we need to catch version-specific breakage before merge. Removes the configure job since the matrix is now static. Still 16 jobs (4×4) vs 32.
Contributor
|
This PR is stale because it has been open for 45 days with no activity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI test runs take ~18 min due to 64% overhead (cache management, redundant installs). This restructures all CI workflows to eliminate that overhead: install once per Python version, share the virtualenv via artifact, and only test 3.12+3.13 on PRs (full matrix on push to main).
Key Changes
.venv; test jobs download it instead of each runninguv syncsetup-uvbuilt-in caching: Eliminates race conditions where 32 jobs competed to save the same cache key (caused 13-min install outliers)tests/**/*.py) never matched actual test dirs (lib/crewai/tests/). Fixed path + switched toleast_durationalgorithm--frozento alluv sync: Skip resolution, install exactly from lockfiletests (3.10)etc.) still satisfiedupdate-test-durations.yml: Path filter never triggered — now matcheslib/*/tests/**/*.py