From ec88b7a0ad8b05fab9dc57a58f20dfbe2b496ac9 Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Tue, 13 Oct 2026 21:36:46 -0700 Subject: [PATCH] Run formatting, vet and test checks in CI The build workflow only ran the goreleaser snapshot build, so tests, vet and formatting were never checked. Add a gofmt check, go vet and go test before the build. Restrict the release workflow to semver tags. Existing tags have no v prefix (1.9.0), so a plain v* filter would have stopped releases; match both 1.2.3 and v1.2.3. actions/checkout@v7 exists, so no version change is needed. Closes #70 --- .github/workflows/build.yml | 6 ++++++ .github/workflows/release.yml | 3 ++- CLAUDE.md | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 202da0d..241a531 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,12 @@ jobs: uses: actions/setup-go@v6 with: go-version-file: 'go.mod' + - name: Check formatting + run: test -z "$(gofmt -l .)" || { gofmt -l .; exit 1; } + - name: Vet + run: go vet ./... + - name: Test + run: go test ./... - name: Install just uses: extractions/setup-just@v4 - name: Install goreleaser diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 693d111..7c30d1f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,8 @@ name: Release on: push: tags: - - '*' + - '[0-9]+.[0-9]+.[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+' permissions: contents: write diff --git a/CLAUDE.md b/CLAUDE.md index 3242962..da5e9ac 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -55,7 +55,7 @@ or `dpkg-deb` invocation). `justfile` wraps the `goreleaser` CLI so `just