ci(e2e): stop building from an older commit's Next.js cache, and fail a stall by name (#2051)

The E2E job restored .next/cache keyed only on the lockfile and next.config.ts, so builds reused a cache saved before newer CSS landed and the new mobile specs failed; the 80-test reporter cadence made it look like a hang until the job timeout. Drop the cache restore; in CI report every test, set an explicit 30 s per-test timeout and a 9-minute global timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
wyucandClaude Opus 5.5 authored and GitHub committed 2026-10-27 20:11:36 +08:00
1 parent 75b3d8b61f
commit b5f4df16bb
2 files changed
+18 -11

No files matched your search

+6 -10
View File
@@ -376,16 +376,12 @@ jobs:
fi
done
# Incremental compilation artifacts only. Keyed on the lockfile plus
# next.config.ts so a dependency or webpack-rule change misses; source
# edits still reuse the restore-key prefix.
- name: Cache Next.js build
uses: actions/cache@v6
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('next.config.ts') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
# No `.next/cache` restore: the build starts cold. The cache was keyed on
# the lockfile and next.config.ts only, so every run restored the
# Turbopack cache of an older commit, and builds from it shipped a stale
# app/globals.css (without the `--safe-area-*` variables the phone
# layout reads) while the rest of the CSS was current. The phone e2e
# specs then failed on every attempt and ran the job out of time.
# Dedicated so a cold `next build` is not charged against Playwright's
# webServer readiness budget (120s). NEXT_PUBLIC_MAIC_EDITOR_ENABLED is a
+12 -1
View File
@@ -8,7 +8,18 @@ export default defineConfig({
// CI builds the production bundle in a dedicated workflow step, so this
// process only drives Chromium. Two workers fit a 4-core runner.
workers: process.env.CI ? 2 : undefined,
reporter: process.env.CI ? 'html' : 'list',
// CI names every test as it finishes (`list`): with `html` alone the run
// printed one unflushed line of dots, so a stall said nothing about which
// test it was.
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list',
// Every test, its hooks and fixtures included, gets 30 s (Playwright's
// default, stated so a spec that raises it does so explicitly).
timeout: 30_000,
// The whole run stops inside the job's 15-minute budget (a passing run takes
// about 6 minutes after a 4-minute setup): Playwright then reports the tests
// still running by name, and the report is uploaded, instead of the job
// being cancelled with neither.
globalTimeout: process.env.CI ? 9 * 60_000 : undefined,
use: {
baseURL: 'http://localhost:3002',
trace: 'on-first-retry',