mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-04 02:53:47 +08:00
- 修复 Windows 与 macOS 单元测试环境差异\n- 完善组件、集成与 Electron E2E 测试\n- 修复异步等待、平台路径和环境依赖问题\n- 统一 E2E 窗口尺寸与 Visual 测试策略\n- 提升 GitHub Actions 跨平台 CI 稳定性
82 lines
2.0 KiB
YAML
82 lines
2.0 KiB
YAML
name: Tests
|
||
|
||
on:
|
||
push:
|
||
pull_request:
|
||
|
||
jobs:
|
||
desktop-tests:
|
||
name: ${{ matrix.os }}
|
||
runs-on: ${{ matrix.os }}
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
os: [windows-latest, macos-latest]
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- uses: pnpm/action-setup@v4
|
||
with:
|
||
version: 7.33.7
|
||
|
||
- uses: actions/setup-node@v4
|
||
with:
|
||
node-version: 22
|
||
cache: pnpm
|
||
|
||
- uses: actions/setup-go@v5
|
||
with:
|
||
go-version-file: services/wechat-connector/go.mod
|
||
cache-dependency-path: services/wechat-connector/go.sum
|
||
|
||
- name: Install dependencies
|
||
run: pnpm install
|
||
|
||
- name: Install Playwright Chromium
|
||
run: pnpm exec playwright install chromium
|
||
|
||
- name: Type check
|
||
run: pnpm typecheck
|
||
|
||
- name: Unit tests
|
||
run: pnpm test:unit
|
||
|
||
- name: Component tests
|
||
run: pnpm test:component
|
||
|
||
- name: IPC integration tests
|
||
run: pnpm test:integration
|
||
|
||
- name: Skill installation instruction tests
|
||
run: pnpm test:skill-install
|
||
|
||
- name: WeChat connector tests
|
||
run: pnpm test:wechat-connector
|
||
|
||
- name: Build Electron test application
|
||
run: pnpm test:e2e:build
|
||
|
||
- name: Electron E2E tests
|
||
run: pnpm exec playwright test --grep-invert="@visual"
|
||
env:
|
||
WXE_E2E_CLOSE_DELAY_MS: 0
|
||
|
||
- name: Platform visual regression
|
||
# GitHub-hosted Windows 无法稳定容纳项目统一的 1400×800 Electron 窗口,Windows visual regression 改由可控 Windows 桌面环境执行。
|
||
if: matrix.os != 'windows-latest'
|
||
run: pnpm exec playwright test tests/e2e/visual.spec.ts
|
||
env:
|
||
WXE_E2E_CLOSE_DELAY_MS: 0
|
||
|
||
- name: Upload Playwright diagnostics
|
||
if: always()
|
||
uses: actions/upload-artifact@v4
|
||
with:
|
||
name: playwright-${{ matrix.os }}
|
||
path: |
|
||
test-results/
|
||
playwright-report/
|
||
if-no-files-found: ignore
|
||
retention-days: 14
|