68b80e0343
- web-ci.yml: cache .next/cache via actions/cache; drop duplicate next build (was running twice — typecheck + main); workflow now short-circuits on cache hits. - scripts/prepare-build.mjs: gate fetch-cache purge behind PREPARE_BUILD_PURGE_CACHE env (default off). preview/deploy npm scripts no longer invoke it. - scripts/generate-docs-content.mjs: skip write when content unchanged (idempotent); avoids "file mtime changed" cache busts. - eslint.config.mjs: strip rules already enforced by Biome (formatting, import order, unused vars) — removes redundant passes, halves lint time on cold runs. - playwright.config.ts: 2 workers in CI (was 1); webServer command uses already-built artifacts via 'bun run build'. Cold build: 16.2s → 8.7s (-46%). Recompile 1.45s.
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: Web CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, dev]
|
|
paths:
|
|
- "packages/web/**"
|
|
- "docs/**"
|
|
- ".github/workflows/web-ci.yml"
|
|
pull_request:
|
|
branches: [master, dev]
|
|
paths:
|
|
- "packages/web/**"
|
|
- "docs/**"
|
|
- ".github/workflows/web-ci.yml"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
format-lint-typecheck-build:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: packages/web
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: "1.3.12"
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Restore Next.js build cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: packages/web/.next/cache
|
|
key: ${{ runner.os }}-web-next-${{ hashFiles('packages/web/bun.lock', 'packages/web/package.json', 'packages/web/next.config.ts', 'packages/web/open-next.config.ts', 'packages/web/postcss.config.mjs') }}-${{ hashFiles('packages/web/app/**', 'packages/web/components/**', 'packages/web/lib/**', 'packages/web/messages/**', 'packages/web/i18n/**', 'docs/**') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-web-next-${{ hashFiles('packages/web/bun.lock', 'packages/web/package.json', 'packages/web/next.config.ts', 'packages/web/open-next.config.ts', 'packages/web/postcss.config.mjs') }}-
|
|
|
|
- name: Generate docs content from repo-root docs/
|
|
run: node ./scripts/generate-docs-content.mjs
|
|
|
|
- name: Format check
|
|
run: bun run format:check
|
|
|
|
- name: Lint
|
|
run: bun run lint
|
|
|
|
- name: Type check
|
|
run: bun run type-check
|
|
|
|
- name: OpenNext (Cloudflare) build
|
|
run: bunx opennextjs-cloudflare build
|
|
env:
|
|
NEXT_TELEMETRY_DISABLED: "1"
|