Ingest and Search #12
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
| # PR CI: conventional-commit lint, golangci-lint, and build/vet/test. Mirrors | |
| # canal's continuous_integration.yml + test.yml, flattened (anfra is a single Go | |
| # module). `ci_passed` is the one required status check (via alls-green). | |
| name: Continuous Integration | |
| on: | |
| pull_request: {} | |
| concurrency: | |
| group: continuous_integration-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| commitlint: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read # wagoid lists the PR's commits via the API | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: wagoid/commitlint-github-action@v6 # validates PR commits against commitlint.config.mjs | |
| lint: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| checks: write # annotate the PR with lint findings | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golangci/golangci-lint-action@v7 | |
| with: | |
| version: v2.6.2 | |
| args: -v --timeout=10m | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - run: go mod download | |
| - name: go.mod is tidy | |
| run: go mod tidy --diff | |
| - run: go build -v ./... | |
| - run: go vet ./... | |
| - run: go test -race -count=1 ./... | |
| # Single required status check: green only when every needed job succeeded. | |
| # Handles skipped-but-required jobs (re-actors/alls-green). | |
| ci_passed: | |
| needs: [commitlint, lint, test] | |
| if: always() && !cancelled() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |