ci(checks): bump nox shards to 4 and introduce shard weights#226
Merged
Abhijeet Prasad (AbhiPrasad) merged 9 commits intomainfrom Apr 8, 2026
Merged
ci(checks): bump nox shards to 4 and introduce shard weights#226Abhijeet Prasad (AbhiPrasad) merged 9 commits intomainfrom
Abhijeet Prasad (AbhiPrasad) merged 9 commits intomainfrom
Conversation
Extract the shared checkout, mise setup, and dependency install steps from the smoke and nox jobs into a reusable composite action at .github/actions/setup-python-env. Increase nox test shards from 2 to 4 for faster parallel execution.
Local composite actions require the repo to be checked out first. Move actions/checkout back into each job, before the composite action reference.
Replace the round-robin (NR % TOTAL) shard assignment with a greedy longest-processing-time-first bin-packing algorithm. Session weights are read from py/scripts/session-weights.json (measured from CI). This brings the 4-shard split from a potential ~60s imbalance to within ~3s.
Replace py/scripts/nox-matrix.sh with py/scripts/nox-matrix.py. The Python version is cleaner and avoids the inline Python heredoc that the shell script was already using for the LPT bin-packing logic. Update the workflow to call the new script.
Add --output-durations flag to nox-matrix.py to capture actual session runtimes from nox output. A new non-blocking check-session-weights job runs after nox, compares measured durations against session-weights.json, and warns when any session drifts beyond 50%. The job is deliberately excluded from checks-passed so it never blocks PRs.
Adds a simple workflow for updating stale weights: download the
measured-durations artifacts from a CI run, then run:
python py/scripts/check-session-weights.py --update measured-*.json
This overwrites session-weights.json with the measured values, adds new
sessions, and preserves sessions that were not measured in this run.
Remove the --output-durations capture and check-session-weights job from the checks workflow. Add a new update-session-weights workflow that runs weekly (Monday 06:00 UTC) or on manual dispatch. It measures all nox session durations on ubuntu/3.13, checks for drift, and opens a PR updating session-weights.json when any session drifts beyond 50%.
ff61015 to
e629c55
Compare
ViaDézo1er / cedric (viadezo1er)
approved these changes
Apr 8, 2026
Contributor
ViaDézo1er / cedric (viadezo1er)
left a comment
There was a problem hiding this comment.
stamp
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.
Extract the shared checkout, mise setup, and dependency install steps from the smoke and nox jobs into a reusable composite action at .github/actions/setup-python-env. Increase nox test shards from 2 to 4 for faster parallel execution and introduce shard weights so the shard sessions are more balanced.