name: CI on: push: branches: [master] pull_request: permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true - name: gofmt run: | out="$(gofmt -l .)" if [ -n "$out" ]; then echo "These files are not gofmt-clean:" echo "$out" exit 1 fi - name: go vet run: go vet ./... - name: Build run: go build ./... - name: Test run: go test ./... - name: Test (race) run: go test -race ./... lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true # .golangci.yml uses the v2 config schema, so this needs golangci-lint # v2.x and action v7+. Left unpinned deliberately: a golangci-lint built # against an older Go toolchain cannot analyse this module at all (the # same reason a locally installed staticcheck built with go1.24 fails on # go.mod's go 1.25). Pin it once a known-good version is confirmed. - uses: golangci/golangci-lint-action@v7 with: version: latest args: --timeout=5m