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) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-27 16:42:04 +00:00
parent ba6a8af251
commit 9150972de9
2 changed files with 18 additions and 2 deletions

View File

@@ -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

View File

@@ -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,