ci(deploy): run the gate from the Taskfile, not an inlined copy (#1580)
deploy.yml inlined its own sequence, which drifted weaker than `task check`: no db:check, news:check or ui:check, so a release could ship stale sqlc output, a stale ui/dist, or release notes that disagree with CHANGELOG.md, and the dashboard suite ran outside the gate without its type check. The release now runs `task check TEST_FLAGS=-count=1`: same definition, the full uncached suite including the Docker-backed tests -short skips. quality.yml already invoked the Taskfile, so both pipelines now share one gate.
This commit is contained in:
1 parent
ad9ec16844
commit
6031a7a14b
3 files changed
+18
-26
No files matched your search
@@ -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
|
||||
|
||||
+6
-4
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user