Skip to content

Conversation

@ffranr
Copy link
Contributor

@ffranr 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.
@ffranr ffranr self-assigned this Nov 19, 2025
@ffranr ffranr added the CI label Nov 19, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Reusable CI Cleanup Action: A new reusable GitHub Action has been introduced to efficiently clean up disk space on CI runners by removing large, non-essential toolsets and caches.
  • Go Cache Management: The Go build cache is now explicitly cleared between multi-platform release builds to prevent disk space issues and ensure artifacts do not mix.
  • Workflow Integration: The new cleanup action is designed to be wired into existing CI workflows, replacing inline cleanup steps for better modularity and maintainability.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/main.yaml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link
Member

@jtobin jtobin left a 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.

@ffranr ffranr force-pushed the wip/build-reduce-disk-space-use branch from 7849dc6 to b865287 Compare November 19, 2025 11:47
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.
@ffranr ffranr force-pushed the wip/build-reduce-disk-space-use branch from b865287 to 3050e97 Compare November 19, 2025 11:50
@ffranr ffranr added this pull request to the merge queue Nov 19, 2025
Copy link
Contributor

@darioAnongba darioAnongba left a 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.

Merged via the queue into main with commit 9ddbd1d Nov 19, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants