Files
MetonaToast/.gitea/workflows/ci.yml
T
tianhao 2516a3a36b
CI / test (18.x) (push) Successful in 10m12s
CI / test (20.x) (push) Successful in 10m7s
CI / test (22.x) (push) Successful in 10m8s
CI / test (24.x) (push) Successful in 10m24s
fix(ci): 修复 YAML 解析失败导致 CI 不触发
- 根因:'Run tests (coverage gate: lines >= 95%)' 未加引号,
  plain scalar 中 'coverage gate:' 的冒号被解析为嵌套 mapping,
  整个 workflow 解析失败 → push 不触发(v0.5.0 引入)
- 修复:name 加单引号;runs-on 恢复 debian-latest(runner 实际标签)
- publish.yml 同步恢复 runs-on
- 验证:两个文件 YAML 解析全部通过
2026-08-08 15:33:28 +08:00

51 lines
1.1 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: debian-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.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: 'Run tests (coverage gate: lines >= 95%)'
run: npx jest --forceExit --maxWorkers=2 --no-cache --coverage
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Build
run: npm run build
- name: Bundle size
run: |
echo "=== Build Output ==="
ls -lh dist/
echo ""
echo "=== Minified Gzip Size ==="
gzip -c dist/metona-toast.min.js | wc -c | xargs echo "min.js gzip:"
gzip -c dist/metona-toast.esm.js | wc -c | xargs echo "esm.js gzip:"