-
Notifications
You must be signed in to change notification settings - Fork 137
CI: add reusable cleanup workflow and clear Go caches #1878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ffranr
commented
Nov 19, 2025
- Add a reusable GH-action that handles disk cleanup for CI runners.
- Wire the cleanup action into existing workflows instead of inline steps.
- Clear Go caches between multi-platform release builds so artifacts don’t mix.
In this commit, we add a call to "go clean -cache" after each platform build in the release script to prevent the Go build cache from accumulating unbounded disk space during the sequential 15-platform build process. When building for multiple platforms in sequence with "go build -v", Go creates intermediate build artifacts and caches compiled packages for each target platform. While this caching improves build performance within a single platform build, it causes the cache to grow substantially when building for many platforms sequentially. With 15 different platform/architecture combinations, each with their own cached artifacts, this accumulation was contributing to the disk space exhaustion. By clearing the build cache after each platform completes, we prevent this unbounded growth while still allowing each individual platform build to benefit from caching during its own compilation. The module cache is preserved (we only clear the build cache), so dependencies don't need to be re-downloaded between platforms.
Summary of ChangesHello @ffranr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the efficiency and reliability of the CI pipeline by optimizing disk space management and Go build processes. It introduces a standardized, reusable GitHub Action for comprehensive runner disk cleanup, which will be integrated across various workflows. Additionally, it addresses a common issue in multi-platform Go builds by ensuring the build cache is cleared, preventing potential conflicts and disk space exhaustion. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a reusable GitHub Action for cleaning up runner disk space and adds a go clean -cache step to the release script to prevent disk space issues during multi-platform builds. The changes are well-structured and improve the CI process. I've added a few suggestions to the cleanup action script to improve its conciseness and readability by combining several rm commands and formatting a long apt-get command.
jtobin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think it can be cleaned up/refined later.
7849dc6 to
b865287
Compare
Define a composite action to remove large toolsets, unused packages, Docker images, and caches from the GitHub runner, freeing up disk space for builds.
Update workflows to use the new `cleanup-space` composite action for clearing runner disk space, replacing the manual `rm -rf` commands. Add a cleanup step to the cross-compilation job.
b865287 to
3050e97
Compare
darioAnongba
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Surprised this is not something GitHub themselves propose though.