Run lint and tests as phases of the Dockerfile (closes #5)
check / check (push) Successful in 2m33s

The Dockerfile gets a lint phase on the pinned golangci-lint v2.12.2
image and a test phase on the Debian Go image. The tests run as an
unprivileged user, because root reads a file with mode 0000 and the
permission test then fails. The build stage copies a file from each
phase, so no build finishes unless both pass, and it no longer runs
make check. script/lint and script/test each build their phase,
uncached and tagged; script/cibuild bootstraps, runs script/check, then
builds the image. script/bootstrap no longer installs golangci-lint.
README.md and TODO.md describe the new setup.

Model: opus-5-5
This commit is contained in:
2026-10-06 04:32:11 +00:00
committed by sneak
parent 4fd857bc32
commit 2d996df335
8 changed files with 103 additions and 53 deletions
+3 -1
View File
@@ -95,7 +95,9 @@ Future improvements under consideration:
* Author & maintainer: **sneak** – <sneak@sneak.berlin>
* Issues / PRs: <https://git.eeqj.de/sneak/attrsum/>
* Code must pass `go vet`, `go test ./...`, and `go fmt`.
* Code must pass `make check`, which runs the tests and golangci-lint as
phases of the `Dockerfile` (Docker is required) and checks formatting
with `gofmt`.
* No CLA; contributions are under WTFPL v2.
---