mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(ci): prune GOCACHE if it gets too big
This commit is contained in:
@@ -169,6 +169,8 @@ jobs:
|
||||
- shasum -a 512 karma-*.tar.gz | tee sha512sum.txt
|
||||
# verify that there are no uncommited changes
|
||||
- git diff --exit-code
|
||||
# prune GOCACHE if it gets too big
|
||||
- ./scripts/prune-go-cache.sh
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
|
||||
14
scripts/prune-go-cache.sh
Executable file
14
scripts/prune-go-cache.sh
Executable 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
|
||||
Reference in New Issue
Block a user