Skip to content

Commit 17ed975

Browse files
committed
add release dry-run and image smoke test to CI
Every push builds a full goreleaser snapshot -- all platform binaries plus the Docker images -- so release configuration breakage surfaces in review, not on tag day. The smoke test runs the amd64 image without env and requires a non-zero exit naming the missing variable, pinning the container's cold-start failure mode. Refs: #21
1 parent dd873b2 commit 17ed975

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,35 @@ jobs:
3737
go-version-file: go.mod
3838
- run: go build ./...
3939
- run: go test -race ./...
40+
41+
release-dry-run:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v7
45+
with:
46+
fetch-depth: 0
47+
- uses: actions/setup-go@v6
48+
with:
49+
go-version-file: go.mod
50+
- uses: docker/setup-qemu-action@v4
51+
- uses: docker/setup-buildx-action@v4
52+
- uses: goreleaser/goreleaser-action@v7
53+
with:
54+
version: "~> v2"
55+
args: release --snapshot --clean
56+
- name: image smoke test
57+
# The image must start, print an actionable error, and exit non-zero
58+
# when required env is missing.
59+
run: |
60+
img=$(docker image ls --format '{{.Repository}}:{{.Tag}}' ghcr.io/gaijinentertainment/go-gerrit-mcp \
61+
| grep -- '-amd64$' | head -n 1)
62+
[[ -n "$img" ]] || { echo "no snapshot image found" >&2; exit 1; }
63+
64+
set +e
65+
out=$(docker run --rm "$img" 2>&1)
66+
code=$?
67+
set -e
68+
69+
printf '%s\n' "$out"
70+
[[ "$code" -ne 0 ]] || { echo "image must exit non-zero without env" >&2; exit 1; }
71+
grep -q GERRIT_URL <<<"$out" || { echo "error must name the missing env var" >&2; exit 1; }

0 commit comments

Comments
 (0)