Avoid running the full E2E suite on every PR/push. Keep fast unit gates and run only test:gate:e2e in VCR replay mode.
50 lines
1011 B
YAML
50 lines
1011 B
YAML
name: test
|
||
|
||
on:
|
||
push:
|
||
branches: [ main, master ]
|
||
paths-ignore:
|
||
- '**.md'
|
||
- 'docs/**'
|
||
pull_request:
|
||
branches: [ main, master ]
|
||
paths-ignore:
|
||
- '**.md'
|
||
- 'docs/**'
|
||
workflow_dispatch:
|
||
workflow_call:
|
||
|
||
jobs:
|
||
test:
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
- name: 检出代码
|
||
uses: actions/checkout@v4
|
||
|
||
- name: 安装 pnpm
|
||
uses: pnpm/action-setup@v2
|
||
with:
|
||
version: 10.5.2
|
||
run_install: false
|
||
|
||
- name: 设置 Node.js 环境
|
||
uses: actions/setup-node@v4
|
||
with:
|
||
node-version: '22'
|
||
cache: 'pnpm'
|
||
|
||
- name: 安装依赖
|
||
run: pnpm install
|
||
|
||
- name: 运行门禁(不含 E2E)
|
||
run: pnpm test:gate
|
||
|
||
- name: 安装 Playwright 浏览器
|
||
run: pnpm exec playwright install --with-deps chromium
|
||
|
||
- name: 运行门禁 E2E(关键用例,VCR 回放模式)
|
||
run: pnpm test:gate:e2e
|
||
env:
|
||
E2E_VCR_MODE: replay
|