Keep modules, lint cache and system packages in check builds (closes #130)
check / check (push) Waiting to run
check / check (push) Waiting to run
On sneak's ruling in #130, check builds keep three more things besides Go's build cache. In each stage of the canonical Go Dockerfile, the system-package install and the module download come before ARG CACHEBUST, so Docker keeps those layers until the base image, the install line, go.mod or go.sum changes. Modules are kept as a layer, not a cache mount, because Go does not check a cache mount's files again. golangci-lint run also mounts golangci-lint's cache. Every step that lints, tests or compiles still comes after ARG CACHEBUST, both go test runs keep -count=1, and a step that also installs node packages stays below the line. The policy, checklists, Go style guide, README and script comments say the same. Model: opus-5-5
This commit was merged in pull request #131.
This commit is contained in:
@@ -21,6 +21,21 @@ fmt-check, and commit.
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-10-18: Check builds may now also keep Go's downloaded modules,
|
||||
golangci-lint's cache and the layers that install system packages (issue 130),
|
||||
on sneak's ruling there. In each stage of the canonical Go `Dockerfile`, the
|
||||
system-package install and the module download (`COPY go.mod go.sum ./`,
|
||||
`RUN go mod download`) come before `ARG CACHEBUST`, so Docker keeps them until
|
||||
the base image, the install line, `go.mod` or `go.sum` changes. The modules
|
||||
are kept as a layer, not a cache mount, because Go does not check the files in
|
||||
a cache mount again. `golangci-lint run` also mounts golangci-lint's cache,
|
||||
`/root/.cache/golangci-lint`. Every step that lints, tests or compiles still
|
||||
comes after `ARG CACHEBUST` and runs on every check build, and both `go test`
|
||||
runs keep `-count=1`. `REPO_POLICIES.md`, both checklists, the Go style guide,
|
||||
the README and the script comments state the rule the same way. This repo's
|
||||
own `Dockerfile` is unchanged: its `script/bootstrap` step also installs node
|
||||
packages, which the ruling does not cover. Repositories pick this up on their
|
||||
next re-vendor.
|
||||
- 2026-10-15: Check builds now keep Go's build cache between runs (issue 113),
|
||||
on sneak's ruling there that Go's compile cache may survive. `script/lint`,
|
||||
`script/test`, `script/cibuild` and `script/docker` pass a new `CACHEBUST`
|
||||
|
||||
Reference in New Issue
Block a user