CI / test-parser (push) Successful in 9m25s
CI / verify (18.x) (push) Successful in 9m55s
CI / verify (20.x) (push) Successful in 9m49s
CI / test-core (push) Successful in 9m34s
CI / test-rest (push) Successful in 9m30s
CI / e2e (push) Successful in 10m57s
CI / verify (24.x) (push) Successful in 9m46s
runner 宿主为 Debian 11,Playwright 1.62 的 install-deps 已不支持; 改用 mcr.microsoft.com/playwright:v1.62.1-noble 容器自带 Chromium 与系统依赖。
105 lines
2.9 KiB
YAML
105 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
|
|
continue-on-error: true
|
|
- name: Build
|
|
run: npm run build
|