perf(ci): decouple e2e from frontend — build frontend inline in e2e job
Some checks failed
Mirror to GitHub / mirror (push) Successful in 14s
CI / frontend (pull_request) Successful in 5m44s
CI / e2e (pull_request) Failing after 7m42s
CI / backend (pull_request) Successful in 10m28s

Before: e2e \`needs: [frontend]\` waited for the frontend job to upload
a build artifact, then downloaded it. With multiple runners this means
the third runner sat idle for ~6 min while frontend ran, then started
e2e — total wall-clock max(backend, frontend+e2e) ≈ 11 min.

After: e2e builds its own frontend (npm ci + npm run build are already
in the job; just dropped the artifact download step and added the
build). e2e starts immediately on a free runner. Adds ~1-2 min to the
e2e job duration but removes ~5 min of waiting and eliminates the
cross-job artifact mechanism entirely.

Side benefit: no more \`actions/upload-artifact\` v3/v4 GHES headaches
on the cross-job handoff. The \`if: always()\` upload of the
playwright-report at the end of e2e is kept (failure report retrieval
is still useful), but it's a leaf-output, not a dependency.

Net wall-clock: max(backend=9m, frontend=6m, e2e=7m) ≈ 9 min on the
3-runner setup, down from ~11 min.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 15:59:00 -04:00
parent 6656ebdead
commit 261814ae65

View File

@@ -125,15 +125,14 @@ jobs:
- name: Build - name: Build
run: cd frontend && NODE_OPTIONS="--max-old-space-size=4096" npm run build run: cd frontend && NODE_OPTIONS="--max-old-space-size=4096" npm run build
- name: Upload build artifact # Build artifact intentionally NOT uploaded. The e2e job below builds
uses: actions/upload-artifact@v3 # its own frontend rather than downloading one from this job, so there
with: # is no need for the cross-job artifact handoff (which previously broke
name: frontend-dist # on actions/upload-artifact@v4 GHES support and forced a v3 pin).
path: frontend/dist # Decoupling also lets e2e start immediately rather than waiting for
retention-days: 1 # this job to finish — important on a multi-runner setup.
e2e: e2e:
needs: [frontend]
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
@@ -188,11 +187,13 @@ jobs:
- name: Install frontend dependencies - name: Install frontend dependencies
run: cd frontend && npm ci run: cd frontend && npm ci
- name: Download frontend build - name: Build frontend
uses: actions/download-artifact@v3 # Building inline (instead of downloading an artifact from the
with: # frontend job) drops the cross-job dependency, so e2e can start
name: frontend-dist # immediately on a free runner. Adds ~1-2 min of build time, but
path: frontend/dist # eliminates the artifact-upload mechanism entirely (no more
# v3/v4 GHES headaches) and saves ~5 min of waiting.
run: cd frontend && NODE_OPTIONS="--max-old-space-size=4096" npm run build
- name: Install Playwright browser - name: Install Playwright browser
run: cd frontend && npx playwright install --with-deps chromium run: cd frontend && npx playwright install --with-deps chromium