From 9150972de91e200e3678ecf80d46035ea7c70c7d Mon Sep 17 00:00:00 2001 From: chihlasm Date: Fri, 27 Mar 2026 16:42:04 +0000 Subject: [PATCH] fix: reuse frontend build artifact in e2e instead of rebuilding The e2e job was running a full Vite build on the same runner as the backend + Postgres, causing OOM. Now: - Frontend job uploads dist/ as an artifact - E2E job depends on frontend, downloads the artifact - Playwright webServer skips build in CI, just runs preview - Locally still builds as before Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yml | 14 ++++++++++++++ frontend/playwright.config.ts | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a62f3a3a..c2040742 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,15 @@ jobs: - name: Build run: cd frontend && NODE_OPTIONS="--max-old-space-size=4096" npm run build + - name: Upload build artifact + uses: actions/upload-artifact@v5 + with: + name: frontend-dist + path: frontend/dist + retention-days: 1 + e2e: + needs: [frontend] runs-on: ubuntu-latest services: @@ -147,6 +155,12 @@ jobs: - name: Install frontend dependencies run: cd frontend && npm ci + - name: Download frontend build + uses: actions/download-artifact@v5 + with: + name: frontend-dist + path: frontend/dist + - name: Install Playwright browser run: cd frontend && npx playwright install --with-deps chromium diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index 7cdc203b..02d8c9dc 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -38,10 +38,12 @@ export default defineConfig({ }, }, { - command: 'NODE_OPTIONS="--max-old-space-size=4096" npm run build && npm run preview -- --host 127.0.0.1 --port 4173', + command: process.env.CI + ? 'npm run preview -- --host 127.0.0.1 --port 4173' + : 'NODE_OPTIONS="--max-old-space-size=4096" npm run build && npm run preview -- --host 127.0.0.1 --port 4173', url: frontendBaseUrl, reuseExistingServer: !process.env.CI, - timeout: 180_000, + timeout: 120_000, env: { ...process.env, VITE_API_URL: apiOrigin,