Skip to content

Commit

Permalink
feat(ci): Improve the bazel cache optimization (#368)
Browse files Browse the repository at this point in the history
Bazel cache currently does not fit into the 10GB quota on GitHub.
  • Loading branch information
sasa-tomic committed May 10, 2024
1 parent 9219db6 commit e7b3a8d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/optimize-bazel-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

0 comments on commit e7b3a8d

Please sign in to comment.