fix(ci): add cache cleaning step to prevent 'no space left on device' errors#4513
Merged
fix(ci): add cache cleaning step to prevent 'no space left on device' errors#4513
Conversation
… 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 时运行
注释掉原先仅在 workflow_dispatch 且 inputs.debug 为 true 时才启动 tmate 的 if 条件,改为始终执行 Setup TMate Session 步骤,便于在更多 CI 场景下进行远程调试。
houseme
approved these changes
Nov 19, 2025
Contributor
There was a problem hiding this comment.
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 -cachebefore 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复ci runner免费的磁盘空间不足导致无法完成单元测试的问题