From d1098570b8c7dc822c0c33529366d4087506be78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C5=A1a=20Tomi=C4=87?= Date: Fri, 10 May 2024 15:22:43 +0200 Subject: [PATCH] feat(ci): Improve the bazel cache optimization Bazel cache currently does not fit into the 10GB quota on GitHub. --- bin/optimize-bazel-cache.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/optimize-bazel-cache.sh b/bin/optimize-bazel-cache.sh index ca072f7b3..6cd81acd4 100755 --- a/bin/optimize-bazel-cache.sh +++ b/bin/optimize-bazel-cache.sh @@ -3,10 +3,16 @@ # Optimize the size of bazel cache # -set -eEuo pipefail +set -eExuo pipefail echo "Bazel cache directory contents:" -ls -l --full-time ~/.cache/bazel || exit 0 # In case bazel cache isn't mounted yet on github, we need to stop here +ls -l --full-time ~/.cache/bazel || exit 0 # In case bazel cache isn't mounted yet on github, we need to stop here + +du -sh --total ~/.cache/bazel/* + +bazel clean du -sh --total ~/.cache/bazel/* + sudo apt install -qy rdfind sudo rdfind -makehardlinks true "$(bazel info output_base | grep .cache | tail -n1)" +du -sh --total ~/.cache/bazel/*