Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch:
inputs:
run_tests:
description: "执行测试(lint + 类型检查)"
description: "执行测试(lint + 类型检查 + E2E)"
type: boolean
default: true
run_build:
Expand Down Expand Up @@ -43,3 +43,41 @@ jobs:
run: npm run lint
- name: Type check
run: npx tsc --noEmit

ui-e2e:
name: UI E2E tests (Playwright)
runs-on: ubuntu-latest
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.run_tests == 'true' }}
steps:
- uses: actions/checkout@v5
with:
submodules: 'recursive'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- name: Install dependencies
run: npm ci
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
- name: Run E2E tests
env:
CI: 'true'
run: npx playwright test
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 14
- name: Upload Playwright traces
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: playwright-traces
path: test-results/
retention-days: 7
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ dist-ssr
target
tsconfig.app.tsbuildinfo
tsconfig.node.tsbuildinfo

# Playwright
/playwright-report/
/playwright/.cache/
/test-results/
.history
target
tsconfig.app.tsbuildinfo
Expand Down
Loading
Loading