Files
pyflowx/.github/workflows/ci.yml
T
zhou 8b7777d936 feat: 初始化PyFlowX轻量级DAG任务调度库
实现完整的DAG任务调度核心功能,包括:
1.  支持同步/异步/线程三种执行策略
2.  自动上下文注入,无需手动绑定任务依赖
3.  内置状态后端,支持断点续跑
4.  提供完整的测试用例与示例代码
5.  添加CI/CD配置与发布流程
2026-06-20 10:41:33 +08:00

132 lines
4.6 KiB
YAML

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ─────────────────────────────────────────────────────────────
# 后端:多平台 × 多 Python 版本矩阵测试
# ─────────────────────────────────────────────────────────────
backend-test:
name: Backend (${{ matrix.os }} / py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.13', '3.14']
exclude:
# macOS + py3.14 暂时跳过(部分依赖未发布 wheel)
- os: macos-latest
python-version: '3.14'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 安装 uv
uses: astral-sh/setup-uv@v5
with:
version: latest
enable-cache: true
cache-dependency-glob: uv.lock
- name: 设置 Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 安装依赖
run: uv sync --extra dev --frozen
- name: Ruff 检查
run: uv run ruff check backend/endo tests
- name: Ruff 格式检查
run: uv run ruff format --check backend/endo tests
- name: 运行测试
env:
PYTHONPATH: backend
run: uv run pytest -v --cov=endo --cov-report=xml --cov-report=term-missing
- name: 上传覆盖率
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-py${{ matrix.python-version }}
path: coverage.xml
retention-days: 7
# ─────────────────────────────────────────────────────────────
# 前端:多平台构建验证
# ─────────────────────────────────────────────────────────────
frontend-build:
name: Frontend (${{ matrix.os }} / node${{ matrix.node-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [20, 22]
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: 设置 Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- name: 安装依赖
run: pnpm install --frozen-lockfile
- name: TypeScript 类型检查
run: npx tsc --noEmit -p tsconfig.app.json
- name: 构建
run: pnpm run build
- name: 上传构建产物
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 22
uses: actions/upload-artifact@v4
with:
name: frontend-dist
path: frontend/dist
retention-days: 7
# ─────────────────────────────────────────────────────────────
# 聚合:所有测试通过后才标记完成
# ─────────────────────────────────────────────────────────────
ci-pass:
name: CI Pass
runs-on: ubuntu-latest
needs: [backend-test, frontend-build]
if: always()
steps:
- name: 检查依赖任务结果
if: ${{ needs.backend-test.result != 'success' || needs.frontend-build.result != 'success' }}
run: |
echo "backend-test: ${{ needs.backend-test.result }}"
echo "frontend-build: ${{ needs.frontend-build.result }}"
exit 1
- name: 全部通过
run: echo "✅ 所有 CI 检查通过"