ci: cache Go modules, build/test cache and the TinyGo .deb #46
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer!46
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/go-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The
gojob runs fully cold on every push:setup-gowithcache: false, the TinyGo .deb downloaded from GitHub, and every module, build and test from scratch. Recent runs took 10:24–13:14 (runs 34, 38–43).Where the time goes (run 43 on
deploy, 10:52 total):go fmt(module downloads)go vet(compiles)go test ./...in dbroutes510 s,pocketbase272 s,federation102 s,permissions80 s (test execution time, not compile)Change (
.forgejo/workflows/ci.yml, go job)actions/cache@v4on~/go/pkg/mod,~/.cache/go-buildand/tmp/wanderer-tinygo-cache. The key is Go/TinyGo version + hash of all go.sum files + commit, with restore-keys for partial hits. GOCACHE also holds thego testresults, so packages whose inputs did not change are not re-run. That is the big win, for web-only and plugin-only pushes above all.actions/cache@v4on the TinyGo .deb, keyed onTINYGO_VERSION. GitHub is hit only on a miss.checkout@v4,setup-go@v5, nowcache@v4), all node20.Prerequisite: the runner's cache server
spl-vm06's runner has
cache.enabled = false(nixos-hostsmodules/ci-runner/default.nix: "the egress policy closes the VM to its own jobs"). Until that changes,actions/cacheonly warns and the job runs cold, exactly as now. See the PR's CI run for proof that it is harmless.Branches
CI runs on push (any branch), not on
pull_request, so this branch's push is its check. The sameci.ymlis ondeploy, with noworkflow_dispatch.deploygets this with the next main→deploy merge (jmz, ff-only), or as the same hunk cherry-picked.🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
Run 45 (this branch): go 10:27, web green. That is the same range as the cold baseline (10:24–13:14, runs 34/38–43), as expected. Both cache steps log
Cache action is only supported on GHES…because spl-vm06's runner hascache.enabled = false, so there is no ACTIONS_CACHE_URL and the job runs cold, unchanged. A second run would be just as cold, so I did not trigger one (single CI slot). The warm-cache number needs the runner cache server enabled first (nixos-hostsmodules/ci-runner).