chore(deps): update dependency golangci/golangci-lint to v2.12.2 (#111) #182
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| # Run on every push and on pull requests targeting main. | |
| on: | |
| push: | |
| branches: ['**'] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Run the full test suite with race detection and generate a coverage report. | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| # Go version is read from go.mod so it stays in sync with the project. | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| # Verify dependency checksums match go.sum (detects corrupted or tampered modules). | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Run tests | |
| run: go test -race -coverprofile=coverage.out -covermode=atomic ./... | |
| # Print coverage summary to the CI log. | |
| - name: Coverage summary | |
| run: go tool cover -func=coverage.out | tail -1 | |
| # Static analysis: go vet for built-in checks, golangci-lint for extended linting. | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Run go vet | |
| run: go vet ./... | |
| # golangci-lint v2 runs 50+ linters in a single pass. | |
| # Without a .golangci.yml config file it uses sensible defaults. | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.12.2 | |
| # Verify the project compiles. Cross-platform builds are handled by | |
| # GoReleaser at release time, so a single-platform check suffices here. | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Build | |
| run: go build -o /dev/null . | |
| # Validate .goreleaser.yml so config errors are caught before tagging a release. | |
| - name: Verify GoReleaser config | |
| uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| args: check | |
| # Scan dependencies for known vulnerabilities using Go's official scanner. | |
| # See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck | |
| govulncheck: | |
| name: govulncheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golang/govulncheck-action@v1 | |
| with: | |
| go-version-file: go.mod |