CI #842
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: [ "**" ] | |
| pull_request: | |
| branches: [ "**" ] | |
| schedule: | |
| - cron: "0 3 * * *" # Nightly at 3am UTC | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26" | |
| - name: Setup dev tools | |
| run: make setup | |
| - name: Lint, test, coverage threshold | |
| run: make ci | |
| - name: Run govulncheck | |
| run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... | |
| - name: Upload coverage to Codecov | |
| if: always() | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.out | |
| fail_ci_if_error: true | |
| integration-test: | |
| if: github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/main') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26" | |
| - name: Setup dev tools | |
| run: make setup | |
| - name: Lint, test, coverage threshold | |
| run: make ci | |
| - name: Run govulncheck | |
| run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... | |
| - name: Run integration tests (race) | |
| run: go test -race ./test/integration/... | |
| - name: Run make test-int | |
| run: make test-int | |
| release-snapshot: | |
| # Exercises .goreleaser.yaml on every push/PR so config drift fails | |
| # here instead of on a real tag push. Skips publish/sign/sbom — those | |
| # are CI-only and tested for real by .github/workflows/release.yml. | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # GoReleaser needs full history for changelog | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: GoReleaser snapshot | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: "~> v2" | |
| args: release --snapshot --clean --skip=publish,sign,sbom |