Files
LangBot/.github/workflows/frontend-tests.yml
huanghuoguoguo 1f227f7aa8 ci: scope PR checks and run the complete matrix daily (#3056)
* ci: streamline pull request checks and run the full matrix daily

Refs #3055

* ci: run runtime contracts only on affected Core checks

* test(ci): distinguish SDK checks from SDK publication

* fix(ci): retain legacy regressions and scope production image builds

* docs(ci): clarify focused regressions and production image selection
2026-11-17 17:31:50 +08:00

75 lines
2.5 KiB
YAML

name: Frontend Tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'web/**'
- '.github/workflows/frontend-tests.yml'
- '.github/workflows/lint.yml'
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: frontend-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
playwright-smoke:
name: Playwright Smoke
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: pnpm/action-setup@v4
with:
version: 8.9.2
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- id: install
name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Frontend lint
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: pnpm lint
- name: Check i18n keys against en-US reference
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: node scripts/check-i18n.mjs
- name: Typecheck frontend on the PR
if: ${{ !cancelled() && steps.install.outcome == 'success' && github.event_name == 'pull_request' }}
run: pnpm exec tsc --noEmit
- name: Frontend unit tests
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: pnpm test:unit
- id: browser
name: Install Playwright browser
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: pnpm exec playwright install --with-deps chromium
- name: Playwright browser checks against Vite dev server
if: ${{ !cancelled() && steps.browser.outcome == 'success' }}
# This suite uses test-only source fixtures that are not in the production bundle.
run: pnpm test:e2e
- name: Production bundle (daily and manual)
if: ${{ !cancelled() && steps.install.outcome == 'success' && github.event_name != 'pull_request' }}
run: pnpm build
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() && steps.browser.outcome == 'success' }}
with:
name: frontend-browser-${{ github.run_attempt }}
path: |
web/playwright-report
web/test-results
if-no-files-found: ignore