1.8 KiB
1.8 KiB
PR 级自动化 CI 流水线说明
仓库使用 .github/workflows/ci.yml 作为 PR 与手动触发(workflow_dispatch)的统一质量闸门,所有 Node 作业统一对齐 Node 24.22.1(与 package.json、apps/detail-agent-pi/package.json 及 Dockerfile 一致)。
作业拆分与路径过滤
changes(scripts/ci/detect-pr-changes.mjs):基于git diff --name-only识别变更范围,避免无关 PR 触发全量重型构建;workflow_dispatch时默认全量执行。security(scripts/ci/check-pr-security.mjs):每个 PR 必跑的快速卡点,拦截.env(*.example除外)、.private/、私钥文件及 diff 新增明文凭据,并执行apps/detail-agent-pi/src/白标静态扫描。web:主站 / 脚本 / Prisma /Dockerfile变更时执行npm run storage:legacy-boundary、npm run typecheck -- --incremental false、npm run test:scripts(含safe-production-migrate.test.mjs与ci-workflows.test.mjs)及npm test -- --maxWorkers=2。agent:apps/detail-agent-pi/或evals/xiaoyi-golden/变更时执行npm run test:agent(含whitelabel、kb-antileak、thin-speed-124)及node --test evals/xiaoyi-golden/tests/*.test.mjs20 模板离线契约烟测。rust:apps/detail-photocraft/变更时在CARGO_INCREMENTAL=0与CARGO_PROFILE_DEV_DEBUG=0下执行x86_64-pc-windows-gnu交叉编译检查与核心纯逻辑 crate 单测,并在if: always()收尾步骤清理target/debug与target/x86_64-pc-windows-gnu/debug防爆盘。
本地校验
node --test scripts/ci-workflows.test.mjs