Indexer-go v2 — decode the new contract event surface + combat sim parity #3
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: Indexer Go CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'indexer-go/**' | |
| - 'proto/**' | |
| - '.github/workflows/indexer-go.yml' | |
| pull_request: | |
| paths: | |
| - 'indexer-go/**' | |
| - 'proto/**' | |
| - '.github/workflows/indexer-go.yml' | |
| concurrency: | |
| group: indexer-go-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: indexer-go | |
| # Scratch Postgres so the env-gated store integration tests (idempotent | |
| # version-guarded upserts, battle replay) run in CI, not just locally. | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_PASSWORD: test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: indexer-go/go.mod | |
| cache-dependency-path: indexer-go/go.sum | |
| - name: Vet | |
| run: go vet ./... | |
| - name: Test (race, with Postgres integration) | |
| env: | |
| TEST_DATABASE_URL: postgresql://postgres:test@localhost:5432/postgres | |
| run: go test -race -count=1 -timeout 300s ./... | |
| - name: Build binaries | |
| run: | | |
| go build -o bin/indexer ./cmd/indexer | |
| go build -o bin/diff ./cmd/diff | |
| - name: Verify proto stubs are current | |
| run: | | |
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | |
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | |
| go install github.com/bufbuild/buf/cmd/buf@latest | |
| buf generate ../proto --template buf.gen.yaml | |
| git diff --exit-code pb/ || { | |
| echo "::error::pb/ stubs are stale — run 'buf generate ../proto --template buf.gen.yaml' in indexer-go/" | |
| exit 1 | |
| } |