Keep Go's build cache in check builds (closes #113)
check / check (push) Canceled after 0s

The script/ builds pass a new CACHEBUST build argument on every run in
place of --no-cache, which also emptied Go's build cache mount. Every
Dockerfile stage declares ARG CACHEBUST first, so every RUN step still
reruns on an unchanged tree. The canonical Go Dockerfile mounts only
Go's build cache, on the steps that compile, so compiled packages
survive between check builds; both go test runs carry -count=1, so no
test result is reused. golangci-lint's own cache and the module cache
are not kept.

A repository re-vendors the scripts and adds the ARG lines in one
commit: a stage without the line is served from cache with no warning.

Unverified: not yet tried on the shared CI runner.

Model: opus-5-5
This commit was merged in pull request #129.
This commit is contained in:
clawbot committed 2026-10-15 16:50:31 +02:00
1 parent f9e23ccae3
commit e3f79c49da
11 files changed
+184 -97

No files matched your search

+5 -4
View File
@@ -1,6 +1,6 @@
---
title: Code Styleguide — Go
last_modified: 2026-10-06
last_modified: 2026-10-15
---
1. Try to hard wrap long lines at 77 characters or less.
@@ -111,9 +111,10 @@ last_modified: 2026-10-06
linting. It carries the lint and test phases, and the final stage depends on
both, so a build makes sure the code is in an able-to-be-compiled state,
linted, and its tests run. Go through `script/cibuild` or `script/docker`
rather than a bare `docker build .`: they pass `--no-cache`, without which
an unchanged tree serves the gate layers from cache and the build reports a
green it never ran.
rather than a bare `docker build .`: they pass a new `CACHEBUST` value on
every build, which reruns every `RUN` step and keeps Go's build cache;
`--no-cache` would empty it. Without a new value an unchanged tree serves
the gate layers from cache and the build reports a green it never ran.
1. Every repo must have a `Makefile`. See
[Repository Policies](https://git.eeqj.de/sneak/prompts/raw/branch/main/prompts/REPO_POLICIES.md)