Speed up CI toward 20s wall clock - #299
Open
rerost wants to merge 7 commits into
Open
Conversation
- lint: drop install-mode=goinstall so golangci-lint is downloaded as a binary instead of compiled from source (~60s saved) - test/build/check-generate: per-job Go module + build caches so the -race test build (~50s) becomes incremental - Docker jobs: bootstrap buildx in a background step, add GHA layer cache, and persist the Dockerfile's go mod/build cache mounts via buildkit-cache-dance; run the two docker image tests in parallel - Dockerfile: add a go-build cache mount to the build stage - Renovate config check: move to its own workflow that only runs when renovate.json changes (npx download of renovate took ~40s per run) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #299 +/- ##
=======================================
Coverage 44.49% 44.49%
=======================================
Files 15 15
Lines 636 636
=======================================
Hits 283 283
Misses 306 306
Partials 47 47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The two docker run tests create and close issues in the same test repository, so running them in parallel races and fails with 422. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The buildx container bootstrap, cache injection, and image load transfer added ~30s of fixed cost to the docker image test job. Build the binary on the runner with the Go build cache instead and override the Dockerfile's builder stage via --build-context, so the docker build only assembles the runtime stage. The full Dockerfile build is still verified by docker_build_and_push on every run. Also use the default GHA cache scope for the push job: on pull_request events github.ref_name is "N/merge", and branch isolation is already handled natively by the Actions cache service. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The lint job was effectively running cold every time: the golangci-lint-action cache had a stale near-empty entry that is never re-saved on cache hit, and the shared setup-go cache never contained golangci's compilation objects. Give lint its own explicit cache (GOCACHE + golangci-lint analysis cache) like the other jobs. Locally golangci-lint runs in ~0.5s warm vs ~4s cold. Add .dockerignore: the build context included .git, so every commit invalidated the go build layer even when no source changed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Investigated https://github.com/rerost/issue-creator/actions/runs/28697434525 (~90s wall clock) and reduced it to ~36s (steady state, measured on this PR).
goinstall; own cache incl. GOCACHE + golangci analysis cache (the action's cache was a stale 330KB entry that is never re-saved on hit, so lint ran cold every time)-racebuild was ~50s; tests themselves run in ~6s)renovate.jsonchangesbuilderstage via--build-context; the full Dockerfile build is still verified by the push jobbuildkit-cache-danceto persist go mod/build cache mounts;.dockerignoreso.gitno longer invalidates the build layer on every commitTechniques borrowed from rerost/giro#303 (background/wait steps, GHA cache scopes).
Notes
go.sumchange repopulates caches and is slower; steady state is as above.renovate.jsonchanges — remove it from required status checks if configured.Test plan
🤖 Generated with Claude Code