Repository navigation
ci: cancel superseded runs and add a test-uv timeout - #25
Merged
Merged
Conversation
test-uv installs uv with astral-sh/setup-uv and stores the uv cache in the GitHub Actions cache, keyed on uv.lock. It also gets a 5-minute timeout. test-docker builds the image with docker/build-push-action and stores the layers in the GitHub Actions cache. Compose then starts the loaded image with --no-build, so a tag mismatch fails the job. Both workflows cancel a PR run when a newer push to the same PR starts.
iamtatsuki05
marked this pull request as draft
November 3, 2026 17:17
The PR runs showed that neither cache saves time here. uv sync takes about 4 s, and the cold run spent 31 s saving a 318 MB uv cache. The warm test-docker run took 160 s against a 150 s baseline median, because pulling the cached layers and loading the image took as long as building it. Keep the concurrency groups and the test-uv timeout.
Repos made from this template add their own dependencies. In nlp-template, which has torch, the slowest test-uv run took 3.9 min, and a run on a slow apt mirror took 4.2 min. A 5-minute limit would fail those runs, while 12 minutes still stops a hung job.
iamtatsuki05
marked this pull request as ready for review
November 3, 2026 18:11
Merged
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.
WHY
CI should run faster and use fewer runner minutes without changing what it checks. This repo is public, so its runner minutes are free. The gain is less wasted runner time here and in the repos made from this template.
When you push a new commit to a PR, the run for the older commit keeps going, and nobody uses its result. MIREI was made from this template and has the same two workflows. There, 26 of 123 test-docker runs were still running when the next push to the same PR started, and they used about 164 runner minutes after they were out of date. This repo had 1 such run in 17. Also, test-uv has no timeout, so a hung job can run for 6 hours.
WHAT
concurrencygroup per workflow and PR, withcancel-in-progress: true. A new push to the PR cancels the run for the older commit.timeout-minutes: 12. Repos made from this template add their own dependencies. In nlp-template, which adds torch, the slowest test-uv run took 3.9 min, and 12 is about 3 times that. This repo's slowest run took 1.6 min.The branch has 3 commits. The first added a uv cache and a Docker layer cache. The second removed both caches after the runs below showed no gain. The third raised the timeout. The net diff is the two items above.
VERIFICATION
cancel-in-progressstops such a run when the next push starts (inferred, because no push superseded a run on this PR).69c2146passed. test-uv took 50 s (run 41690525628) and test-docker 199 s (run 41690525447), against baseline medians of 48 s and 150 s over 17 runs. The image build, which this PR does not touch, took 174 s of that.Prepared 224 packages in 4.00s), and the cold run spent 31 s saving a 318 MB cache (run 41681555715).CACHEDsteps, against the 150 s baseline median. Pulling about 900 MB of cached layers took about 82 s, and loading the image into Docker took 34.5 s (run 41681555683, attempts 1 and 2).actions/checkout@v2,actions/checkout@v3, andactions/setup-python@v4) are ondeveloptoo.RISKS AND REMAINING WORK
pushtrigger ondevelop. Without a cache, there is nothing to warm.uv run toxinstalls every package again, because the bind mount hides the image's.venv. Fixing that means changingcompose.yml.