[CI] Free hosted-runner disk space only when it is low (#33644)

This commit is contained in:
Liangsheng Yin
2026-08-04 21:55:06 -07:00
committed by GitHub
parent 059269594c
commit eac1f78568
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -62,7 +62,12 @@ jobs:
steps:
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
# The image ships ~65G free and the suite peaks around 30G; deleting
# these trees is ~1M unlinks (~80s), so only pay it when actually low.
avail_gb=$(df --output=avail -BG / | tail -1 | tr -dc '0-9')
if [ "${avail_gb}" -lt 40 ]; then
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
fi
df -h
- name: Checkout code
+6 -1
View File
@@ -245,7 +245,12 @@ jobs:
steps:
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
# The image ships ~65G free and the suite peaks around 30G; deleting
# these trees is ~1M unlinks (~80s), so only pay it when actually low.
avail_gb=$(df --output=avail -BG / | tail -1 | tr -dc '0-9')
if [ "${avail_gb}" -lt 40 ]; then
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
fi
df -h
- name: Checkout code