Repository navigation
fix(ci): add Linux host disk cleanup for CI builds - #1057
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a reusable “host cleanup” step for Linux CI to reduce disk usage and avoid build failures caused by running out of space on hosted runners.
Changes:
- Added an Azure DevOps template to remove unused SDK/toolchain directories and some snap packages on Linux.
- Wired the AzDO cleanup template into both Linux test jobs.
- Added a GitHub Actions composite action for the same cleanup and invoked it from the main CI workflow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
build/ci/host-cleanup-linux.yml |
New AzDO cleanup template that removes preinstalled toolchains/SDKs to free disk space. |
build/ci/stage-build-linux-tests.yml |
Calls the new cleanup template in both Linux jobs. |
.github/actions/host-cleanup-linux/action.yml |
New GHA composite action implementing the Linux cleanup commands. |
.github/workflows/ci.yml |
Adds a step to run the new cleanup composite action before .NET setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Extract host-cleanup-linux.sh shared script used by both AzDO and GHA - Use conditional sudo for container compatibility - Use apt-get purge instead of apt remove - Use rm -rf consistently - Add || true on all sudo lines for best-effort cleanup
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Adds a Linux host disk cleanup step to all Linux CI jobs to reclaim disk space by removing unused pre-installed software.
Why
Linux CI agents accumulate ~20–30 GB of pre-installed software (Cargo, Rust, Swift, Edge, GHC, Mono, Android SDK, CodeQL, snapd) that is not needed for builds. This cleanup step runs at the start of each Linux job to ensure sufficient disk space.
Details
host-cleanup-linux.sh) called by both the AzDO template and GHA composite actioncondition: eq(variables['Agent.OS'], 'Linux')/if: runner.os == 'Linux')sudo -n(non-interactive) probe to work safely in both host and container environments|| true) withtimeoutguards on snap/apt-get commandsDEBIAN_FRONTEND=noninteractivefor apt-get to prevent dpkg promptsPart of org-wide CI disk cleanup initiative.
Related to https://github.com/unoplatform/uno.rider/pull/480