Skip to content

Commit fc94e84

Browse files
committed
ci: add Linux host disk cleanup step for CI builds
1 parent a459d04 commit fc94e84

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Host Cleanup (Linux)'
2+
description: 'Remove unused toolchains and SDKs to free disk space on Linux runners'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Cleanup unused image dependencies
8+
if: runner.os == 'Linux'
9+
shell: bash
10+
run: |
11+
echo "Disk space before cleanup:"
12+
df -h /
13+
rm -fR ~/.cargo ~/.rustup ~/.dotnet
14+
sudo rm -fR /usr/share/swift /opt/microsoft/msedge /usr/local/.ghcup /usr/lib/mono /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
15+
sudo snap remove lxd || true
16+
sudo snap remove core20 || true
17+
sudo apt remove -y snapd || true
18+
echo "Disk space after cleanup:"
19+
df -h /

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ jobs:
9090
with:
9191
fetch-depth: 0
9292

93+
- name: Free disk space (Linux)
94+
uses: ./.github/actions/host-cleanup-linux
95+
9396
- name: Download Artifact
9497
uses: actions/download-artifact@v4
9598
with:

0 commit comments

Comments
 (0)