Keep Go's build cache between builds for make test (closes #124)
check / check (push) Successful in 1m23s

The Dockerfile runs make test with Go's build cache in a BuildKit cache
mount, so a build compiles only what changed since the last one instead
of the standard library and every dependency from nothing. script/test
passes -count=1, so no test result is taken from the cache.

Model: opus-5-5
This commit is contained in:
2026-10-06 05:25:30 +00:00
parent 4ff0d20c10
commit a64614f5ce
5 changed files with 23 additions and 5 deletions
+4 -2
View File
@@ -604,7 +604,8 @@ provide:
- `script/build` — build the `secret` binary into the repo root, stamping the
version (`VERSION` from the environment, else `git describe`) and the git
commit
- `script/test` — run `go vet` and the test suite (verbose rerun on failure)
- `script/test` — run `go vet` and the test suite (verbose rerun on failure),
every test on every run, never a result from Go's test cache
- `script/lint` — run `golangci-lint` in docker only: builds `Dockerfile.lint`,
where the linter is a build step that runs on every call, also on an unchanged
tree
@@ -624,7 +625,8 @@ provide:
- `script/cibuild` — CI entrypoint: `docker build --ulimit memlock=-1:-1 .`
(memguard needs mlock; the Dockerfile runs the checks), with a new
`CHECK_EPOCH` build argument on every run so the checks run again on an
unchanged tree
unchanged tree; the `Dockerfile` keeps Go's build cache between builds, so
`make test` compiles only what changed
- `script/precommit` — pre-commit checks: `go mod tidy` verification, then
`script/check`
- `script/install-precommit` — install the git pre-commit hook that runs