e728dcd226
① D11 HTML 报告 RustFS 单源化(TECH_DEBT P2 清偿):可视化产物写任务临时目录后
裸传报告键 html/reports/{filename}(文件名寻址),/html StaticFiles 挂载删除,
新增 html_report_router 根路径代理(报告键→遗留 JSON 包装→本地卷兜底→404,
防穿越);URL 形状 /html/{filename} 不变,持久化引用零迁移;celery 摘除
html_data 卷,镜像不再烤入陈旧报告;顺带删除 get_stp_file_with_data 死数据块
② OCC 方案 B(D10 清偿):run_occ(op_name, payload) 契约 + 常驻工作进程池
(occ_process_pool + occ_worker 操作注册表),超时/崩溃 terminate 换新补位、
任务级超时 recover 整体重建,残留线程泄漏根治;TopoDS 不跨进程(generate_cavity
分模 + 方案 STEP 持久化全在子进程内,返回 export_manifest);删除内存形状缓存链、
CADExporter.export_mold_results、shape_loader(→ stp_materializer)
③ OCC 方案 A 部署参数:CELERY_CONCURRENCY / CELERY_MAX_TASKS_PER_CHILD 进
Dockerfile.celery + compose + .env.example
④ D2 诚实标注:铝价响应带 source: "simulated",前端按来源渲染标注(原硬编码
"上海期货交易所"属虚假声明),死代码 getAluminumPrice 删除
⑤ CI 门禁:.gitea/workflows/ci.yml 三 job(pytest / 前端构建含 vue-tsc /
openapi 漂移检测)
接口变更三件套随批完成(openapi 76→77 paths + gen:api + 前端构建通过;方案 B
接口面零变化)。测试基线 143 passed, 0 skipped(新增 16 项)。文档六处同步。
Co-Authored-By: Claude Code <noreply@anthropic.com>
69 lines
2.9 KiB
YAML
69 lines
2.9 KiB
YAML
# CI 门禁(Gitea Actions,语法与 GitHub Actions 兼容)
|
||
#
|
||
# 三个 job:
|
||
# 1. backend-tests —— pytest 全量(sqlite+aiosqlite,无外部服务依赖;
|
||
# OCC 契约测试在无 pythonocc 的 pip 环境自动 skip)
|
||
# 2. frontend-build —— npm ci + npm run build(含 vue-tsc -b 类型检查,D15 已修复)
|
||
# 3. openapi-drift —— 用 OCC 环境重导出 openapi.json 与仓库版本比对,
|
||
# 防止接口变更三件套(AGENTS §2)被遗漏导致前后端漂移
|
||
#
|
||
# 运行前提:Gitea 实例启用 Actions 且注册了 runner;
|
||
# `ubuntu-latest` label 需映射到带 node/git 的镜像(gitea runner 默认映射满足)。
|
||
# 已验证事实:pytest 与 openapi 导出均不依赖 .env(settings 惰性校验)。
|
||
|
||
name: CI
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
pull_request:
|
||
|
||
jobs:
|
||
backend-tests:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-python@v5
|
||
with:
|
||
python-version: "3.12"
|
||
- name: Install dependencies
|
||
# requirements.txt 自带阿里云 pip 镜像配置
|
||
run: pip install -r requirements.txt
|
||
- name: Run tests
|
||
run: python -m pytest tests/ -q
|
||
|
||
frontend-build:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-node@v4
|
||
with:
|
||
node-version: 20
|
||
- name: Install dependencies
|
||
working-directory: frontend
|
||
run: npm ci
|
||
- name: Type check and build
|
||
working-directory: frontend
|
||
run: npm run build
|
||
|
||
openapi-drift:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- name: Install Miniforge and pythonocc
|
||
# pythonocc-core 仅经 conda-forge 提供(与 deploy/Dockerfile.moldinsight 同版本约束)
|
||
# 默认走 TUNA 镜像(Gitea 服务器多为国内网络);海外环境可换回官方源
|
||
run: |
|
||
wget -q https://mirrors.tuna.tsinghua.edu.cn/github-release/conda-forge/miniforge/LatestRelease/Miniforge3-Linux-x86_64.sh -O miniforge.sh
|
||
bash miniforge.sh -b -p "$HOME/miniforge"
|
||
"$HOME/miniforge/bin/conda" create -n ci -c https://mirrors.tuna.tsinghua.edu.cn/conda-forge -y python=3.12 pythonocc-core=7.9.0
|
||
- name: Install python dependencies
|
||
run: "$HOME/miniforge/envs/ci/bin/pip" install -r requirements.txt
|
||
- name: Export openapi.json and compare with committed version
|
||
run: |
|
||
"$HOME/miniforge/envs/ci/bin/python" -c "import sys; sys.path.insert(0, 'src'); from entrypoints.unified import app; import json; print(json.dumps(app.openapi(), ensure_ascii=False, indent=2))" > /tmp/openapi.json
|
||
git diff --exit-code --no-index /tmp/openapi.json openapi.json || {
|
||
echo "::error::openapi.json 与代码不一致——请按 docs/API_CONTRACT.md §4 重导出并执行 npm run gen:api"
|
||
exit 1
|
||
}
|