[CI] Free hosted-runner disk space only when it is low (#33644)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user