Sprint 4 T-B-24 · Lighthouse CI (G3 闸门真实化)
- apps/web/lighthouserc.cjs: desktop preset, 3 runs, P/A/B/S ≥ 90 断言 - apps/web/scripts/lhci-scores.cjs: 本地汇总脚本(median P/A/B/S + ✅/❌ 标记) - .github/workflows/web-ci.yml: 新增 lighthouse job,treosh/lighthouse-ci-action@v12 - apps/web/package.json: +lhci script - apps/web/.gitignore: .lighthouseci/ 加入忽略(避免本地 12 个 run 报告污染 repo) 本地验证(desktop preset, 3 runs × 4 URLs): perf=100 a11y=95-96 best=96 seo=91 (全部 ≥ 90 ✅) G3 闸门状态:typecheck ✅ / lint ✅ / vitest 69 ✅ / e2e 84/84 ✅ / build 87.85KB ✅ / Lighthouse P/A/B/S ✅ / 真实后端 ⏳(T-B-27)/ Poster CLI Docker ⏳(T-C-44)
This commit is contained in:
39
.github/workflows/web-ci.yml
vendored
39
.github/workflows/web-ci.yml
vendored
@@ -127,3 +127,42 @@ jobs:
|
||||
workingDir: apps/web
|
||||
buildScriptName: build
|
||||
exitZeroOnChanges: true
|
||||
|
||||
lighthouse:
|
||||
# G3 闸门真实化:P/A/B/S 均 ≥ 90
|
||||
runs-on: ubuntu-latest
|
||||
needs: ci
|
||||
timeout-minutes: 15
|
||||
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
run: pnpm --filter @gaokao/web build
|
||||
|
||||
- name: Run Lighthouse CI (G3 闸门:P/A/B/S ≥ 90)
|
||||
uses: treosh/lighthouse-ci-action@v12
|
||||
with:
|
||||
configPath: ./apps/web/lighthouserc.cjs
|
||||
uploadArtifacts: true
|
||||
temporaryPublicStorage: true
|
||||
runs: 3
|
||||
serverUrl: http://127.0.0.1:8080/
|
||||
# treosh action 自动启动 vite preview @ 8080
|
||||
url: |
|
||||
http://127.0.0.1:8080/
|
||||
http://127.0.0.1:8080/data-query
|
||||
http://127.0.0.1:8080/plans
|
||||
http://127.0.0.1:8080/about
|
||||
|
||||
Reference in New Issue
Block a user