chore(deps): bump go.mongodb.org/mongo-driver/v2 from 2.1.0 to 2.6.1 #120
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@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| # Pinned: `latest` drifts and newer gosec rules (G703/G704) fail CI on | |
| # patterns kshark guards at runtime. Bump deliberately + re-validate. | |
| version: v2.6.0 | |
| - 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@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - 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@v7 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |