ci: Windows 的 pnpm 安装目录改成每次运行都干净的路径
构建客户端 / 检查(类型 + 单元测试) (push) Successful in 1m11s
构建客户端 / macOS 通用(.app + .dmg) (push) Skipped
构建客户端 / Windows x64(NSIS 安装包) (push) Failing after 28s
构建客户端 / Linux x64(deb + AppImage) (push) Canceled after 1m36s

run 13 里 装 Rust 这次是好的(上次那个 panic 是两轮运行重叠、同时写 ci-rustup 造成的),
但 装 pnpm 挂了:

    [Error: ENOTEMPTY: directory not empty, rmdir
      'C:\Users\admin\runner\windows\cache\ci-pnpm\node_modules\.bin\store\v11\projects']

原因是这个 dest 是固定路径:pnpm 把自己算出来的 store 建在 dest 里面(就是之前日志里
那个很怪的 <dest>\node_modules\.bin\store\v11),下一轮 action 的自安装器要清掉旧目录
时,嵌套的 store\v11\projects 非空,rmdir 就失败了。

改成 ${{ github.workspace }}\..\ci-pnpm —— 落在本次运行的 work 目录里,每次都是干净的,
同时也还满足"低完整性只能写 runner 自己的工作目录"。机器上那个被污染的
cache\ci-pnpm 已经删掉。
This commit is contained in:
2026-10-15 23:21:16 +08:00
parent c9ce7b64ef
commit de7263569c
+6 -2
View File
@@ -431,8 +431,12 @@ jobs:
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v4
with: with:
version: ${{ env.PNPM_VERSION }} version: ${{ env.PNPM_VERSION }}
# 默认 dest 是 ~/setup-pnpm,而 ~ 是中完整性的,低完整性写不进去。 # 两个原因不用默认的 ~/setup-pnpm(中完整性写不进去),也不用固定的
dest: C:\Users\admin\runner\windows\cache\ci-pnpm # cache 目录:pnpm 会把自己算出来的 store 建在这个 dest 里面,下一次运行
# 自安装器清理旧目录时就炸了 ——
# ENOTEMPTY: directory not empty, rmdir '...\ci-pnpm\node_modules\.bin\store\v11\projects'
# 所以放到本次运行的 work 目录下(每次都是干净的)。
dest: ${{ github.workspace }}\..\ci-pnpm
- name: 装 Node - name: 装 Node
uses: actions/setup-node@v4 uses: actions/setup-node@v4