Files
zcode-mulm e2b81e7ee6 fix(cleanup): per-run 缓存清理改容器 root 执行(PLAT-014,坑 #18 同族)
宿主 08-30 治理后为非 root gitea-runner,rm 容器 root 属主缓存文件必 EACCES
(Seabed run 917 两 attempt 测试全绿、清理步必死)。复用 job 已拉的 node-image
find -mindepth 1 -delete + 宿主 rmdir 自建目录。v3 不动;合并后打 v4,
per-run 调用方(Seabed)升 @v4,fixed 调用方(Reef)可留 @v3。
2026-08-31 20:52:23 +08:00

46 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# mu-ref/ci-workflows
公司级 CI 共享资产(est org)——跨项目复用的 reusable workflow 模板与工具。
架构决策与铁律见 coordination `runbooks/ci-repo-architecture.md`2026-08-27 用户拍板)。
## 内容
| 路径 | 用途 |
|---|---|
| `.gitea/workflows/reusable/node-quality.yml` | node 质量门(digest helper、持久缓存、rank 源序、actions-checkout checkout |
| `.gitea/workflows/reusable/oci-build-push-verify.yml` | 镜像构建+推送+verify-command 校验链 |
| `tools/ci/source-policy.sh` | 唯一选源实现(公司级 canonical) |
| `tools/ci/helper/REGISTER.md` | ci-node-* helper 镜像 digest 注册 |
| `tools/ci/stats.sh` | Gitea Actions 运行统计(REPOS 必填) |
## 铁律
1. 本仓**不得出现项目专名**(reef/seabed 等)与任何 secrets——项目参数(矩阵、build args、verify 期望值)一律由调用方 `with:`/`secrets: inherit` 传入。
2. workflow 文件只保留 `workflow_call` 触发(不可直接触发);`has_actions=false`
3. **版本化调用**:调用方一律 `uses: est/ci-workflows/.gitea/workflows/reusable/<name>.yml@vN`;重大变更升新 tag 并逐项目回归。
4. 可见性:**public(org 级闸门实测)**——跨仓 reusable 读取不按触发用户 token 校验:私有 org(est)内的仓即使 repo 级 public/limited 也被拒(Gitea 1.27.2 实测三档全否);本仓内容为无秘密的公共资产(同 mu-ref/actions-* 待遇),故由 **public orgmu-ref** 宿主承载。est org 保持 private。
## 调用样例
```yaml
jobs:
quality:
uses: https://git.moneywood.site/mu-ref/ci-workflows/.gitea/workflows/reusable/node-quality.yml@v1
with: { ... }
secrets: inherit
```
## 迁移与同步
- 2026-08-27 定稿:曾按初版决策试建 est/ci-workflows,因 est org 私有闸门不可跨仓调用而删除(用户改批 mu-ref 宿主);同日自 est/Est-Infra 上移 tools/ci。
- 2026-08-31 v4PLAT-014Issue #75):per-run 缓存清理步改容器 root 执行(node-image `find /cleanup-root -mindepth 1 -delete` + 宿主 `rmdir`)——08-30 非 root runner 治理后宿主 rm 撞容器 root 属主文件必 EACCES(坑 #18 同族,Seabed run 917 两次复现);v3 保持不动,per-run 调用方(est/Seabed)应升 @v4fixed 模式调用方(est/Reef)无清理步可留 @v3
- 2026-08-29 v3:模板 checkout 恢复 mu-ref/actions-checkout@v4JS action+ HEAD==SHA postcondition——P1-10 的 JS 迁移(est/Est-Infra@57cc9f708-27 09:39)在 08-27 12:07 上移建仓时被回退为 P1-7 host-clone fallback 血统,v3 恢复并经 Seabed 私仓探针验证;无调用方的孤儿模板 `reusable/checkout.yml` 删除(reusable 不可嵌套调用,其守卫已内联进两个模板)。
- helper Dockerfile 的可复现 bake 与 ops 巡检脚本仍属项目级(Est-Infra / gitea-host-setup)。
## Runner contract2026-08-30 定死)
- **唯一 runnerTN `tn-build-runner`gitea-runner v3.3.1,注册号 est org 范围)**TS 只承载 Gitea/Registry,无任何 runner0.6.1/act_runner 已全部清除,禁止回潮。
- 服务:TN `gitea-runner.service`**非 root 用户 `gitea-runner`**docker 组,host docker socket 经组权限),capacity=1,工作区 `/data/ci-workspace`,缓存 `/data/actcache``/data/cache/ci`
- Labels(均 host 模式):`build-docker`(存量 workflow 兼容)与 `est-tn-v3`(新 workflow 请用这个带版本的)。
- 注册令牌:注册完成后即重置;凭据 `/opt/act-runner/.runner` 0600,目录 0700。