diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c24e82534..2c92a3cc4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -96,35 +96,25 @@ jobs: - name: Pull test container images run: docker pull alpine:3 + # One definition of the gate, in the Taskfile. This step used to inline + # its own list, which drifted weaker than `task check`: it ran no + # db:check, news:check or ui:check, so a release could ship stale + # generated SQL, a stale ui/dist, or release notes that disagree with + # CHANGELOG.md. It also ran the dashboard suite here rather than in the + # gate, where test:ui runs it with the type check. TEST_FLAGS is the one + # difference -- the release runs the whole suite, uncached and including + # the Docker-backed tests -short skips. The diff after it asserts + # `task fmt` changed nothing. - name: Quality gate run: | - # The formatter sequence has one owner: task fmt, which drives go fix - # to a fixpoint and then the configured lint formatters. This step - # used to inline its own single `go fix ./...`, which leaves the - # redundant loop-variable copy that copyloopvar rejects -- the hazard - # of archie-core-wwho, surfacing here as a spurious git-diff failure - # (archie-core-6kda). - task fmt + task check TEST_FLAGS=-count=1 git diff --exit-code - bash tools/proto.sh lint - bash tools/proto.sh check - go vet ./... - golangci-lint run ./... - go build ./... - go test ./... -count=1 - name: Vulnerability scan run: | go install golang.org/x/vuln/cmd/govulncheck@latest govulncheck ./... - # The dashboard suite runs in CI too, or it only ever runs when - # someone remembers to; the Go steps above never touch it. - - name: Dashboard tests - run: | - pnpm --dir ui install --frozen-lockfile - pnpm --dir ui test - - name: Release tags must match changelogs run: | set -e diff --git a/RELEASING.md b/RELEASING.md index 08c47ddd8..4bd723c3e 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -127,10 +127,12 @@ Release asset is the durable, operator-reachable one. ## Gate -CI (`deploy.yml`) runs `task check` before building images, then verifies any -release tag at `HEAD` has a matching `[version]` section in `CHANGELOG.md`. A -tag with no changelog entry is a hard failure. No tags at `HEAD` is a warning, -not a failure — images get stamped `dev`. +CI (`deploy.yml`) runs `task check TEST_FLAGS=-count=1` before building images, +then verifies any release tag at `HEAD` has a matching `[version]` section in +`CHANGELOG.md`. The gate has one definition, in the Taskfile: the release runs +it with the uncached suite, including the Docker-backed tests `-short` skips. +A tag with no changelog entry is a hard failure. No tags at `HEAD` is a +warning, not a failure -- images get stamped `dev`. One consequence worth knowing when a release commit needs amending: GitHub Actions runs the workflow **from the commit that triggered it**, so a fix to diff --git a/Taskfile.yml b/Taskfile.yml index 3f56becf2..f29f80554 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -263,9 +263,9 @@ tasks: - go build -trimpath -ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.RUNTIME_VERSION}} -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" -o {{.BIN_DIR}}/archie-agent ./cmd/archie-agent test: - desc: Run short Go tests with caching + desc: Run Go tests; the release gate passes TEST_FLAGS=-count=1 cmds: - - go test -short ./... + - go test {{.TEST_FLAGS | default "-short"}} ./... image:agent: desc: Build the agent image stamped with this checkout's version