From 6cad7d54223fff7326b659c738872510148cf434 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 9 Sep 2026 11:04:03 -0400 Subject: [PATCH] ci: run integration tests with services --- .github/workflows/quality.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 5d764bd..b9f819e 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -15,8 +15,39 @@ jobs: node-version: 22 cache: npm - run: npm ci + - name: Start integration services + env: + POSTGRES_PASSWORD: ci-password + POSTGRES_DB: pokemon_inventory + POSTGRES_USER: pokemon_inventory + POSTGRES_PORT: 5433 + REDIS_PORT: 6380 + run: | + cat > .env <<'EOF' + API_PORT=3000 + DATABASE_URL=postgresql://pokemon_inventory:ci-password@localhost:5433/pokemon_inventory + POSTGRES_DB=pokemon_inventory + POSTGRES_PASSWORD=ci-password + POSTGRES_PORT=5433 + POSTGRES_USER=pokemon_inventory + REDIS_PORT=6380 + REDIS_URL=redis://localhost:6380 + TEST_DATABASE_URL=postgresql://pokemon_inventory:ci-password@localhost:5433/pokemon_inventory_test + TEST_REDIS_URL=redis://localhost:6380 + SMTP_URL=smtp://localhost:1025 + SMTP_FROM=no-reply@example.test + MFA_ENCRYPTION_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + EOF + npm run db:up + docker compose exec -T postgres createdb -U pokemon_inventory pokemon_inventory_test || true + DATABASE_URL=postgresql://pokemon_inventory:ci-password@localhost:5433/pokemon_inventory_test npm run db:migrate - run: npx playwright install --with-deps chromium - run: npm test + - name: Run integration tests + env: + TEST_DATABASE_URL: postgresql://pokemon_inventory:ci-password@localhost:5433/pokemon_inventory_test + TEST_REDIS_URL: redis://localhost:6380 + run: npm run test:integration - run: npm run test --workspace=@pokemon-inventory/web - run: npm run build --workspace=@pokemon-inventory/web - run: npm run build-storybook --workspace=@pokemon-inventory/web