mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-07 09:42:05 +00:00
94199a016b
Speed up all go jobs by ~58s by not cleaning the disk when there's at least 50GB available. The job was added because some runners only have like 15GB available (I assume self-hosted), but on regular GHA runners which have about 90GB free, this job will now always skip. Co-authored-by: techknowlogick <techknowlogick@gitea.com>
23 lines
662 B
YAML
23 lines
662 B
YAML
name: free-disk-space
|
|
description: Free space on / before large cache restores
|
|
|
|
# Delete preinstalled toolchains which gitea doesn't use and show disk space usage
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- shell: bash
|
|
run: |
|
|
avail=$(df --output=avail -BG / | tr -dc '0-9')
|
|
if [ "$avail" -ge 50 ]; then
|
|
echo "skipping cleanup, ${avail}G free"
|
|
exit 0
|
|
fi
|
|
echo "free space before cleanup:"
|
|
df -h /
|
|
for dir in /usr/local/lib/android /usr/local/.ghcup /opt/ghc /usr/share/dotnet; do
|
|
sudo rm -rf "$dir" &
|
|
done
|
|
wait
|
|
echo "free space after cleanup:"
|
|
df -h /
|