Skip to content

fix(ci): add Linux host disk cleanup for CI builds#2036

Merged
agneszitte merged 3 commits into
mainfrom
dev/agzi/ci-linux-host-cleanup
Mar 30, 2026
Merged

fix(ci): add Linux host disk cleanup for CI builds#2036
agneszitte merged 3 commits into
mainfrom
dev/agzi/ci-linux-host-cleanup

Conversation

@agneszitte

@agneszitte agneszitte commented Mar 29, 2026

Copy link
Copy Markdown
Member

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

  • Adds a GHA composite action (.github/actions/host-cleanup-linux/action.yml) with inline cleanup script
  • Cleanup is conditional on Linux (if: runner.os == 'Linux')
  • Uses sudo -n (non-interactive) probe to work safely in both host and container environments
  • All removals are best-effort (|| true) with timeout guards on snap/apt-get commands
  • Uses DEBIAN_FRONTEND=noninteractive for apt-get to prevent dpkg prompts
  • Removed redundant cleanup call from linux-template-tests job (the run-tests action already invokes it internally)

Part of org-wide CI disk cleanup initiative.
Related to https://github.com/unoplatform/uno.rider/pull/480

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a reusable Linux host cleanup composite action and wires it into CI jobs to mitigate disk space exhaustion on ubuntu-latest runners.

Changes:

  • Introduces .github/actions/host-cleanup-linux composite action to remove preinstalled toolchains/SDKs and report disk usage.
  • Adds the cleanup action after checkout in the build and linux-template-tests jobs.
  • Replaces the inline cleanup in run-tests composite action with a call to the new cleanup action.

Reviewed changes

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

File Description
.github/workflows/ci.yml Adds Linux disk cleanup steps to the build and Linux matrix test jobs.
.github/actions/host-cleanup-linux/action.yml New composite action encapsulating the Linux runner cleanup logic.
.github/actions/ci/run-tests/action.yml Removes duplicated inline cleanup and calls the new cleanup action instead.

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

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/actions/host-cleanup-linux/action.yml Outdated
Comment thread .github/actions/host-cleanup-linux/action.yml Outdated
- Add informational comment block about base image
- Use conditional sudo via command -v
- Use rm -rf consistently
- Add individual || true on every sudo line
- Add apt-get purge snapd
- Add df -h before/after for diagnostics
@agneszitte agneszitte changed the title ci: add Linux host disk cleanup step for CI builds fix(ci): add Linux host disk cleanup for CI builds Mar 29, 2026
@agneszitte
agneszitte requested a review from Copilot March 29, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


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

Comment thread .github/actions/ci/run-tests/action.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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


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

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/actions/host-cleanup-linux/action.yml

@kazo0 kazo0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved

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.

3 participants