Skip to content

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

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

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 shared shell script (host-cleanup-linux.sh) called by both the AzDO template and GHA composite action
  • Cleanup is conditional on Linux (condition: eq(variables['Agent.OS'], '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

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

This PR introduces a reusable Linux “host cleanup” step for both Azure DevOps pipelines and GitHub Actions to reclaim disk space on CI runners, then wires it into the WASM build and WASM UI test jobs to reduce disk exhaustion failures.

Changes:

  • Added an AzDO reusable steps template to remove unused SDKs/toolchains on Linux runners.
  • Added a matching reusable GitHub composite action and invoked it in the GHA CI workflow.
  • Replaced existing inline cleanup in the AzDO WASM pipeline and added cleanup to the WASM UI test pipeline.

Reviewed changes

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

Show a summary per file
File Description
build/workflow/templates/host-cleanup-linux.yml New AzDO steps template encapsulating Linux disk cleanup.
build/workflow/build-wasm.yml Replaces inline cleanup bash with the shared cleanup template.
build/workflow/stage-uitests-wasm.yml Adds the shared cleanup template to the Linux WASM UI test job.
.github/actions/host-cleanup-linux/action.yml New composite action implementing the same Linux cleanup for GHA.
.github/workflows/ci.yml Invokes the new composite cleanup action before .NET setup in the WASM build job.

💡 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
@agneszitte agneszitte changed the title ci: add Linux host disk cleanup 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 6 out of 6 changed files in this pull request and generated 1 comment.


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

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 6 out of 6 changed files in this pull request and generated no new comments.


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

@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

@agneszitte
agneszitte merged commit d54bcee into main Mar 30, 2026
22 checks passed
@agneszitte
agneszitte deleted the dev/agzi/ci-linux-host-cleanup branch March 30, 2026 15:45
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