Skip to content

Bump actions/setup-go from 5 to 6 (#63) #322

Bump actions/setup-go from 5 to 6 (#63)

Bump actions/setup-go from 5 to 6 (#63) #322

Workflow file for this run

name: General workflows
on:
push:
branches: [master]
pull_request:
branches: [master]
# Cancel superseded runs on a branch so a force-push / amend doesn't waste CI.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
verify:
name: Verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
# Keep in sync with go.mod's `go` directive (currently 1.19). Using
# stable runs the newest toolchain Go will accept while still
# exercising the minimum language level declared in go.mod.
go-version: stable
check-latest: true
cache: true
- name: Verify go.mod / go.sum are tidy
run: |
go mod tidy
if ! git diff --quiet go.mod go.sum; then
echo "::error::go.mod or go.sum is not tidy — run 'go mod tidy' locally and commit."
git diff go.mod go.sum
exit 1
fi
- name: Check gofmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "::error::The following files are not gofmt'd:"
echo "$unformatted"
exit 1
fi
- name: go vet
run: go vet ./...
- name: go build
run: go build ./...
- name: Install mockgen
# Required by the //go:generate directives across the tree.
# Pinned to v1.6.0 to match the github.com/golang/mock dep in go.mod.
run: go install github.com/golang/mock/mockgen@v1.6.0
- name: go generate produces no diff
run: |
go generate ./...
if ! git diff --quiet; then
echo "::error::go generate produced changes — regenerate mocks locally and commit."
git status
git diff
exit 1
fi
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
# Pinned because golangci-lint v1.64.5 ships its own bundled type-
# checker; using `stable` makes that typechecker fail to resolve
# methods promoted through embedded external types (e.g. testify's
# suite.Suite.Assert), even though `go build` and `go test` succeed.
# The pin must satisfy go.mod's `go` directive; bump in lockstep
# when go.mod's minimum changes.
go-version: '1.24'
check-latest: true
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Pin a recent stable release; bump with intent, not passively.
# When bumping the linter, also bump go-version above to match.
version: v1.64.5
args: --timeout=5m
test:
name: Test Coverage
runs-on: ubuntu-latest
needs: verify
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: stable
check-latest: true
cache: true
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Unit Test
run: make test
- name: Upload coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=cover.out -service=github