fix(ci): prune GOCACHE if it gets too big

This commit is contained in:
Łukasz Mierzwa
2020-04-07 17:37:34 +01:00
parent f017354915
commit e79ec02660
2 changed files with 16 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
GOCACHE=$(go env GOCACHE)
SIZE=`du -sxm ${GOCACHE} | awk '{print $1}'`
echo "GOCACHE size: ${SIZE}MB"
if [ $SIZE -gt 3500 ]; then
echo "Pruning GOCACHE at ${GOCACHE}"
find "${GOCACHE}" -type f -delete
fi