ci: 共享 pnpm store 加速本地 runner

This commit is contained in:
que01 committed 2026-10-23 16:09:25 +08:00
1 parent b43b6f2785
commit b82aa12875
4 files changed
+24 -11

No files matched your search

+4 -2
View File
@@ -35,7 +35,9 @@ Runner 与本地开发工作共用 `Elitebook` 主机,不再与生产 API 共
## 缓存
Runner 内置 cache server(`cache.host=172.17.0.1`、`cache.port=8193`、`cache.dir=~/gitea-runner/cache-data`),供 `actions/setup-node` 的 pnpm 缓存使用。
Runner 内置 cache server(`cache.host=172.17.0.1`、`cache.port=8193`、`cache.dir=~/gitea-runner/cache-data`),供 `actions/cache` 使用(Turbo 缓存等)。
pnpm 依赖不再走 actions/cache:宿主机 `~/gitea-runner/pnpm-store` 被 bind mount 到任务容器的 `/workspace/.pnpm-store`,workflow 的 `npm_config_store_dir` 指向该路径。同一轮 CI 里的 static、build、api、browser-smoke 共享一份 store,`pnpm install` 只做链接/校验,不再重复下载 1600+ 个包。
如果 runner 主机启用了 `ufw`,任务容器到 cache server 的流量会被 `INPUT DROP` 拦截,需要显式放行 Docker 使用的三个私网网段;本地工作站未启用 `ufw`,无需配置:
@@ -79,7 +81,7 @@ Runner 日志级别保持 `debug`:`info` 级别不会记录各 step 的 `Succe
| Production build | 11.7 min | 7.6 min |
| API integration | 9.7 min | 3.8 min |
缓存内容为 pnpm store,首次落盘约 268 MB,位于 `~/gitea-runner/cache-data`。
缓存内容为 pnpm store,首次落盘约 1.1 GB,位于 `~/gitea-runner/pnpm-store`(共享 bind mount)。
## 触发范围