chore(deps): bump golangci/golangci-lint-action from 6 to 9 #66
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| - name: Build | |
| run: CGO_ENABLED=0 go build -o kshark ./cmd/kshark | |
| - name: Test | |
| run: go test ./... -v -race -timeout 120s -coverprofile=coverage.out | |
| - name: Coverage report | |
| run: go tool cover -func=coverage.out | |
| - name: Coverage gate | |
| run: | | |
| TOTAL=$(go tool cover -func=coverage.out | grep '^total:' | awk '{print substr($3, 1, length($3)-1)}') | |
| echo "Total coverage: ${TOTAL}%" | |
| THRESHOLD=40 | |
| if [ "$(echo "$TOTAL < $THRESHOLD" | bc)" -eq 1 ]; then | |
| echo "::error::Coverage ${TOTAL}% is below ${THRESHOLD}% minimum" | |
| exit 1 | |
| fi | |
| - name: Vulnerability check | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| govulncheck ./... | |
| release: | |
| name: Release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write # Required for keyless cosign signing via GitHub OIDC | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v3 | |
| - name: Install syft (SBOM generator) | |
| uses: anchore/sbom-action/download-syft@v0 | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v5 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |