修复:插件面板实例级 i18n / undo-redo 滚动保持 / shortcutHelp 卸载残留 / CSS.escape 环境崩溃 / 大纲光标按源码行号定位 / setLocale 即时刷新 / 浮动工具栏 CJK 宽度 / ko 语言包括号 新增:setOutline(isOutline) 运行时大纲 API、getRenderCacheSize 观测接口 测试:841 → 871(补 7 个事件断言、5 个配置项、修 3 处恒真断言) 工程:CI lint 阻断、build.sh npm ci、rollup 死代码清理、覆盖率阈值门禁
104 lines
2.9 KiB
YAML
104 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
test-parser:
|
|
runs-on: debian-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run parser tests
|
|
run: npx jest tests/parser.test.ts tests/highlight.test.ts --forceExit --maxWorkers=1 --testTimeout=15000
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
test-core:
|
|
runs-on: debian-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run core tests
|
|
run: npx jest tests/core.test.ts tests/plugins.test.ts tests/index.test.ts --forceExit --maxWorkers=1 --testTimeout=15000
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
test-rest:
|
|
runs-on: debian-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Run remaining tests
|
|
run: npx jest tests/themes.test.ts tests/i18n.test.ts tests/utils.test.ts tests/animations.test.ts tests/styles.test.ts --forceExit --maxWorkers=1 --testTimeout=15000
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
e2e:
|
|
runs-on: debian-latest
|
|
# 使用 Playwright 官方镜像:自带 Chromium 与全部系统依赖,
|
|
# 避免 runner 宿主(Debian 11)不被 Playwright 1.62 支持的问题。
|
|
container: mcr.microsoft.com/playwright:v1.62.1-noble
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.x
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Verify Playwright browsers
|
|
run: npx playwright install chromium
|
|
- name: Run E2E smoke tests
|
|
run: npm run test:e2e
|
|
|
|
verify:
|
|
runs-on: debian-latest
|
|
timeout-minutes: 15
|
|
strategy:
|
|
matrix:
|
|
node-version: [18.x, 20.x, 24.x]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Type check
|
|
run: npm run typecheck
|
|
- name: Lint
|
|
run: npm run lint
|
|
- name: Build
|
|
run: npm run build
|