Add pool HTTP API, wire node-status endpoint, and fix metrics test #5
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", "claude/**"] | |
| pull_request: | |
| branches: ["main"] | |
| jobs: | |
| # ── owm-coordinator ────────────────────────────────────────────────────────── | |
| coordinator: | |
| name: coordinator — build, vet, test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: owm-coordinator | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: owm | |
| POSTGRES_PASSWORD: owm | |
| POSTGRES_DB: owm_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U owm" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| cache-dependency-path: owm-coordinator/go.sum | |
| - name: Install protoc | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq protobuf-compiler | |
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | |
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | |
| - name: Generate protobuf stubs | |
| run: | | |
| protoc \ | |
| --go_out=. --go_opt=paths=source_relative \ | |
| --go-grpc_out=. --go-grpc_opt=paths=source_relative \ | |
| proto/coordinator/v1/coordinator.proto | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: go vet | |
| run: go vet ./... | |
| - name: Build coordinator binary | |
| run: go build ./cmd/coordinator | |
| - name: Run unit tests | |
| run: go test -v -count=1 -race ./... | |
| env: | |
| OWM_TEST_DSN: postgres://owm:owm@localhost:5432/owm_test | |
| - name: Check for uncommitted generated files | |
| run: git diff --exit-code | |
| # ── Lint (golangci-lint) ───────────────────────────────────────────────────── | |
| lint: | |
| name: golangci-lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: owm-coordinator | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| cache-dependency-path: owm-coordinator/go.sum | |
| - name: Install protoc | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq protobuf-compiler | |
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | |
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | |
| - name: Generate protobuf stubs | |
| run: | | |
| protoc \ | |
| --go_out=. --go_opt=paths=source_relative \ | |
| --go-grpc_out=. --go-grpc_opt=paths=source_relative \ | |
| proto/coordinator/v1/coordinator.proto | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: latest | |
| working-directory: owm-coordinator | |
| args: --timeout=5m | |
| # ── Docker build check ─────────────────────────────────────────────────────── | |
| docker: | |
| name: Docker build | |
| runs-on: ubuntu-latest | |
| needs: coordinator | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build coordinator image (no push) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: owm-coordinator | |
| push: false | |
| tags: owm-coordinator:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |