* refactor(editor-app): 改进架构和类型安全 * refactor(editor-app): 开始拆分 Inspector.tsx - 创建基础架构 * refactor(editor-app): 完成 Inspector.tsx 拆分 * refactor(editor-app): 优化 Inspector 类型定义,消除所有 any 使用 * refactor(editor): 实现可扩展的属性渲染器系统 * Potential fix for code scanning alert no. 231: Unused variable, import, function or class Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * fix(ci): 防止 Codecov 服务故障阻塞 CI 流程 --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
91 lines
1.8 KiB
YAML
91 lines
1.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, main, develop ]
|
|
paths:
|
|
- 'packages/**'
|
|
- 'package.json'
|
|
- 'package-lock.json'
|
|
- 'tsconfig.json'
|
|
- 'jest.config.*'
|
|
- '.github/workflows/ci.yml'
|
|
pull_request:
|
|
branches: [ master, main, develop ]
|
|
paths:
|
|
- 'packages/**'
|
|
- 'package.json'
|
|
- 'package-lock.json'
|
|
- 'tsconfig.json'
|
|
- 'jest.config.*'
|
|
- '.github/workflows/ci.yml'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Type check
|
|
run: npm run type-check
|
|
|
|
- name: Lint check
|
|
run: npm run lint
|
|
|
|
- name: Build core package first
|
|
run: npm run build:core
|
|
|
|
- name: Run tests with coverage
|
|
run: npm run test:ci
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
continue-on-error: true # 即使失败也继续
|
|
with:
|
|
file: ./coverage/lcov.info
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20.x'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Build npm package
|
|
run: npm run build:npm
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-artifacts
|
|
path: |
|
|
bin/
|
|
dist/
|
|
retention-days: 7 |