Merge pull request #22 from conallob/claude/improve-coverage-further #131
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: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'claude/**' | |
| pull_request: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| go: ['1.24', '1.25'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: Configure toolchain | |
| run: go env -w GOTOOLCHAIN=local | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run tests | |
| run: go test -v -race -coverprofile=./coverage.txt ./... | |
| - name: Build | |
| run: | | |
| go build -o bin/ ./cmd/promql-fmt | |
| go build -o bin/ ./cmd/label-check | |
| go build -o bin/ ./cmd/alert-hysteresis | |
| go build -o bin/ ./cmd/autogen-promql-tests | |
| go build -o bin/ ./cmd/e2e-alertmanager-test | |
| go build -o bin/ ./cmd/stale-alerts-analyzer | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' && matrix.go == '1.25' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| file: ./coverage.txt | |
| flags: unittests | |
| name: codecov-umbrella | |
| golangci: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.8 | |
| goreleaser-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Check GoReleaser config | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: "~> v2" | |
| args: check | |
| goreleaser-consistency: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate GoReleaser consistency | |
| run: | | |
| chmod +x scripts/validate-goreleaser-consistency.sh | |
| ./scripts/validate-goreleaser-consistency.sh |