From 3abad4970feb709ed92894a2f505990d5df26a6a Mon Sep 17 00:00:00 2001 From: kirti Date: Sat, 4 Jul 2026 15:16:33 +0000 Subject: [PATCH] ci: provision pgvector Postgres + migrate for DB-backed test suites The integration *.spec.ts suites need a live Postgres (schema applied) at DATABASE_URL. Run on the dind-builder runner in a job container with a pgvector/pgvector:pg16 service (proven pattern from go-monorepo CI), point DATABASE_URL at the service, and 'prisma migrate deploy' before pnpm test. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b21f30..1403d11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,32 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: dind-builder + # Clean Ubuntu with Node tooling; proven on this runner (matches go-monorepo CI). + # A job container is required so the `services:` Postgres is reachable by its + # service name (`postgres`) on the shared job network. + container: + image: catthehacker/ubuntu:act-latest + + # pgvector Postgres for the DB-backed *.spec.ts integration suites. The specs + # read DATABASE_URL (set below) and fall back to localhost:5434 for local + # `docker compose` dev; in CI they connect to this service at postgres:5432. + services: + postgres: + image: pgvector/pgvector:pg16 + env: + POSTGRES_USER: iios + POSTGRES_PASSWORD: iios + POSTGRES_DB: iios + options: >- + --health-cmd "pg_isready -U iios" + --health-interval 10s + --health-timeout 5s + --health-retries 10 + + env: + DATABASE_URL: postgresql://iios:iios@postgres:5432/iios?schema=public + steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -28,4 +53,7 @@ jobs: # TS2307 "Cannot find module '@insignia/iios-contracts'". - run: pnpm -r build - run: pnpm -r typecheck + # Apply the schema to the CI Postgres before the DB-backed specs run + # (reset-db.ts TRUNCATEs existing tables; migrations must exist first). + - run: pnpm --filter @insignia/iios-service exec prisma migrate deploy - run: pnpm test