Skip to content

修复 Windows 打包缓存路径警告#28

Merged
amazing-fish merged 1 commit into
mainfrom
codex/fix-github-actions-caching-errors
Jan 8, 2026
Merged

修复 Windows 打包缓存路径警告#28
amazing-fish merged 1 commit into
mainfrom
codex/fix-github-actions-caching-errors

Conversation

@amazing-fish

Copy link
Copy Markdown
Owner

Motivation

  • GitHub Actions 在 Windows runner 上缓存 pip 时提示缓存路径不存在导致无法保存缓存,需要为打包流程指定并创建可用的缓存目录。
  • 在工作流中提前创建缓存目录可以避免 Path Validation Error 并提升后续依赖安装的缓存命中率。
  • 此次变更为 CI 配置层面的 bugfix,按锚点约定需同步更新 anchor.md 的最近约定变更记录。

Description

  • .github/workflows/build-exe.ymlbuild job 中设置环境变量 PIP_CACHE_DIR${{ runner.temp }}\pip-cache 并新增步骤提前创建该目录。
  • actions/cachepath~/.cache/pip 修改为 ${{ env.PIP_CACHE_DIR }},并在 pip install 时加上 --cache-dir "$env:PIP_CACHE_DIR" 参数以使用该缓存目录。
  • 更新 anchor.md 的“最近约定变更”条目,记录本次 bugfix(不触发版本号)。

Testing

  • 运行了 python -m compileall todo_app 进行语法检查,所有模块编译通过且返回成功。
  • 无法在本环境直接触发 GitHub Actions 运行打包流程以验证缓存行为,需在推送/在 runner 上运行标签触发的 workflow 时在 CI 中最终验证。

Codex Task

@amazing-fish
amazing-fish merged commit 1f1498c into main Jan 8, 2026
@amazing-fish
amazing-fish deleted the codex/fix-github-actions-caching-errors branch January 10, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant