Run cleanup-disk removals in parallel (#766)

This commit is contained in:
Glenn Jocher
2026-06-11 00:16:32 +02:00
committed by GitHub
parent f70adb6261
commit c21835eaf9
+9 -2
View File
@@ -14,13 +14,20 @@ runs:
echo "::endgroup::"
echo "::group::Remove Tool Cache and Swap"
# Remove tool cache to free up ~15GB of space per https://github.com/ultralytics/ultralytics/pull/15848
rm -rf /opt/hostedtoolcache || true
toolcache_pid=""
if [ -e /opt/hostedtoolcache ]; then
# Remove tool cache to free up ~15GB of space per https://github.com/ultralytics/ultralytics/pull/15848
rm -rf /opt/hostedtoolcache &
toolcache_pid=$!
fi
# Remove swap space to free up ~4GB
if [ -f /swapfile ]; then
sudo swapoff -a
sudo rm -f /swapfile
fi
if [ -n "$toolcache_pid" ]; then
wait "$toolcache_pid" || true
fi
echo "::endgroup::"
echo "::group::Disk Space After Cleanup"