check / check (push) Failing after 5s
REPO_POLICIES.md, .golangci.yml, the CI workflow and the scripts the policy keeps identical across repositories are copies of the files at that commit. .gitignore, .editorconfig and the new .dockerignore are the canonical files followed by this repository's own entries. The lint stage moves to the golangci-lint image the policy pins, in the same commit as .golangci.yml. The format check leaves the lint stage and runs on the host from script/check, which script/cibuild now runs after script/bootstrap. The last Dockerfile stage runs script/bootstrap. script/fmt runs goimports with go run at a pinned commit. Model: opus-5-5
37 lines
1.5 KiB
Docker
37 lines
1.5 KiB
Docker
# Lint stage. The format check is not here: it runs on the host, in
|
|
# script/fmt-check.
|
|
# golangci/golangci-lint:v2.14.0 (Debian-based), 2026-09-24
|
|
FROM golangci/golangci-lint@sha256:ad862ba6b3798cbe0fd9fd7408d498fd74fbd2623a92406b2fd3898faf0bf98f AS lint
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
# Called directly: make lint is itself a docker build of this stage.
|
|
RUN golangci-lint run --config .golangci.yml ./...
|
|
|
|
# Test stage: run full test suite under the race detector
|
|
# golang 1.22.12 (Debian-based; -race needs its C toolchain), 2025-02-04
|
|
FROM golang@sha256:1cf6c45ba39db9fd6db16922041d074a63c935556a05c5ccb62d181034df7f02 AS test
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
# Called directly: make test is itself a docker build of this stage.
|
|
RUN go test -timeout 90s -race -cover ./... || \
|
|
{ echo "--- Rerunning with -v for details ---"; \
|
|
go test -timeout 90s -race -v ./...; exit 1; }
|
|
|
|
# Final stage: a development environment, set up by script/bootstrap.
|
|
# The copies make a plain docker build run both stages above. No stage
|
|
# compiles a binary, since simplelog is a library, so none declares the
|
|
# VERSION build argument that script/docker and script/cibuild pass.
|
|
# golang 1.22.12 (2025-02-04)
|
|
FROM golang@sha256:1cf6c45ba39db9fd6db16922041d074a63c935556a05c5ccb62d181034df7f02
|
|
COPY --from=lint /src/go.sum /dev/null
|
|
COPY --from=test /src/go.sum /dev/null
|
|
WORKDIR /src
|
|
COPY script/ script/
|
|
COPY go.mod go.sum ./
|
|
RUN script/bootstrap
|
|
COPY . .
|