From c21835eaf96b6358b5e6e23bbdfd13c8b16375a9 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 11 Jun 2026 00:16:32 +0200 Subject: [PATCH] Run cleanup-disk removals in parallel (#766) --- cleanup-disk/action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cleanup-disk/action.yml b/cleanup-disk/action.yml index 1102e67..e14592b 100644 --- a/cleanup-disk/action.yml +++ b/cleanup-disk/action.yml @@ -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"