Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(ci): add cache cleaning step to prevent 'no space left on device' errors#4513

Merged
hailaz merged 16 commits intomasterfrom
fix/nospace
Nov 19, 2025
Merged

fix(ci): add cache cleaning step to prevent 'no space left on device' errors#4513
hailaz merged 16 commits intomasterfrom
fix/nospace

Conversation

@hailaz
Copy link
Contributor

@hailaz hailaz commented Nov 17, 2025

修复ci runner免费的磁盘空间不足导致无法完成单元测试的问题

  1. 移动example单测到ci sub中
  2. 使用go clean -cache清理避免短期内再次出现空间不足的问题

… device"

将缓存清理步骤从 coverage 分支移除,改为在 examples 目录构建后清理缓存,避免重复清理并减少磁盘占用
… left on device” 问题

scripts: 更新 .github/workflows/scripts/ci-main.sh,在 examples 目录和其它模块构建后统一执行 go clean -x
- 移除 examples 构建块中的 go clean -x,避免在构建子模块时执行不必要的清理
- 在遍历模块时,当 dirpath 为根目录时提前执行 go clean -cache,以解决 CI 中的 "no space left on device" 问题
- 删除遍历结束处多余的 go clean -x 调用
ci: 在 ci-main.yml 中于 Checkout 后新增 Setup TMate Session 步骤;该步骤仅在 workflow_dispatch 且 inputs.debug 为 true 时运行
@hailaz hailaz closed this Nov 17, 2025
注释掉原先仅在 workflow_dispatch 且 inputs.debug 为 true 时才启动 tmate 的 if 条件,改为始终执行 Setup TMate Session 步骤,便于在更多 CI 场景下进行远程调试。
@hailaz hailaz reopened this Nov 19, 2025
@hailaz hailaz requested a review from houseme November 19, 2025 03:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses CI disk space issues by reorganizing test execution and adding cache cleanup. The changes move example tests from the main CI pipeline to the sub CI pipeline and introduce a cache cleaning step to prevent "no space left on device" errors during test runs.

Key Changes:

  • Moved example repository cloning and building from ci-main.sh to ci-sub.sh to distribute CI workload
  • Added go clean -cache before running tests on the root directory to free up disk space
  • Added workflow_dispatch trigger with debug mode support using tmate for troubleshooting CI issues

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/scripts/ci-sub.sh Added example cloning logic and handling; examples are now built (but not tested) in the sub CI pipeline
.github/workflows/scripts/ci-main.sh Removed example handling logic and added cache cleaning step before root directory tests; examples now skipped in main CI
.github/workflows/ci-main.yml Added manual workflow trigger with tmate debugging capability for CI troubleshooting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hailaz hailaz merged commit 54453c8 into master Nov 19, 2025
32 checks passed
@hailaz hailaz deleted the fix/nospace branch November 19, 2025 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants