Make the CI gate work on Gitea by building instead of bind-mounting
Tests / vet + fmt + tests (pull_request) Successful in 27s
Tests / vet + fmt + tests (push) Successful in 6s

This commit was merged in pull request #1.
This commit is contained in:
2026-09-01 20:33:04 +02:00
parent 05dc042e49
commit d44c941a92
5 changed files with 26 additions and 25 deletions
+8 -5
View File
@@ -1,7 +1,7 @@
# Reproducible test/build image. `docker build .` fails if vet or tests fail,
# so it doubles as CI. Day-to-day, prefer `docker compose run` (bind-mounts
# source, no rebuilds). GO_VERSION defaults to the latest stable Go; override it
# to test the lowest supported version: docker build --build-arg GO_VERSION=1.22 .
# The merge gate: `docker build .` fails if vet, formatting or tests fail, and CI
# runs exactly this. Day-to-day, prefer `docker compose run` (bind-mounts source,
# no rebuilds). GO_VERSION defaults to the latest stable Go; override it to test
# the lowest supported version: docker build --build-arg GO_VERSION=1.22.12 .
ARG GO_VERSION=1.26.4
FROM golang:${GO_VERSION}
@@ -12,4 +12,7 @@ COPY go.mod ./
RUN go mod download
COPY . .
RUN go vet ./... && go test ./...
RUN go vet ./... && \
{ unformatted="$(gofmt -l .)"; test -z "$unformatted" || \
{ echo "unformatted files:"; echo "$unformatted"; exit 1; }; } && \
go test ./...