From 1dbf1cfcd68c1df0ce1a72540055b5ac68dd14bc Mon Sep 17 00:00:00 2001 From: Devarshi Shimpi Date: Mon, 23 Nov 2026 00:41:31 +0530 Subject: [PATCH] ci: run playwright e2e tests in github actions (#186) --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ad884ca..3b13dd6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,15 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + redis: + image: redis:7-alpine + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 env: DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/codra_test TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/codra_test @@ -91,3 +100,23 @@ jobs: - name: Build (worker bundle, dry run) run: cd apps/worker && npx wrangler deploy --dry-run --outdir=.wrangler/dry + + - name: Install Playwright browsers + run: npx playwright install chromium --with-deps + + - name: Prepare E2E environment + run: | + cp .env.e2e.example .env.e2e + node -e "import('postgres').then(async ({default: p}) => { const sql = p('postgresql://postgres:postgres@127.0.0.1:5432/postgres'); await sql\`CREATE DATABASE codra_e2e\`.catch(() => {}); await sql.end(); })" + DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/codra_e2e npm run migrate + + - name: Run Playwright E2E tests + run: npm run test:e2e + + - name: Upload Playwright report + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + if: failure() + with: + name: playwright-report + path: playwright-report/ + retention-days: 14