Branch CI no longer runs the GoReleaser snapshot build. test.yml lints, tests and runs `goreleaser check`, which validates the release config without compiling; release.yml stays the only workflow that builds, and only for v* tags whose commit is on main. `make check` mirrors this with a release-check target, and `make snapshot` remains for local packaging checks. 0.2.0 is not yet released, so its notes now say it ships under EUPL-1.2: the licence entry moves into the 0.2.0 section, dated 2026-11-30, and README states that releases up to 0.1.2 were published under AGPL-3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
name: Test
|
|
|
|
# Every branch push, and no pull_request trigger: branches are pushed
|
|
# directly, so each commit runs once. Branch pushes lint and test but build
|
|
# no binaries; binaries are built only by release.yml, for tags on main.
|
|
on:
|
|
push:
|
|
branches: ['**']
|
|
|
|
jobs:
|
|
check:
|
|
name: Lint and test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
# setup-go@v5 installs the release named by go.mod's go line; the go
|
|
# command then switches to its toolchain line. Fail if it did not.
|
|
- name: Check the Go toolchain
|
|
run: |
|
|
want="$(sed -n 's/^toolchain //p' go.mod)"
|
|
have="$(go env GOVERSION)"
|
|
echo "go.mod toolchain: ${want:-none}; running: $have"
|
|
[ "$have" = "$want" ]
|
|
|
|
# The gofmt on PATH is setup-go's; the one under GOROOT belongs to the
|
|
# toolchain the go command switched to.
|
|
- name: gofmt
|
|
run: |
|
|
unformatted="$("$(go env GOROOT)/bin/gofmt" -l .)"
|
|
if [ -n "$unformatted" ]; then
|
|
echo "These files need gofmt:"; echo "$unformatted"; exit 1
|
|
fi
|
|
|
|
- name: goimports
|
|
run: |
|
|
unformatted="$(go tool goimports -l .)"
|
|
if [ -n "$unformatted" ]; then
|
|
echo "These files need goimports:"; echo "$unformatted"; exit 1
|
|
fi
|
|
|
|
# Prints the change and fails, without writing, if go.mod or go.sum
|
|
# is not tidy.
|
|
- name: go mod tidy
|
|
run: go mod tidy -diff
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
- name: staticcheck
|
|
run: go tool staticcheck ./...
|
|
|
|
# The limit is per package: a hung test fails with every goroutine's
|
|
# stack instead of being killed by the runner.
|
|
- name: Test (race detector)
|
|
run: go test -race -timeout 5m ./...
|
|
|
|
# Validates .goreleaser.yaml without building anything, so a config
|
|
# error fails here rather than on a tag. Same pin as release.yml.
|
|
- name: GoReleaser config check
|
|
uses: goreleaser/goreleaser-action@v6
|
|
with:
|
|
distribution: goreleaser
|
|
version: '2.20.3'
|
|
args: check
|