diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70f8a2ce14..5163b46786 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,6 +136,12 @@ jobs: - name: install rustup components if: steps.cache.outputs.cache-hit != 'true' run: rustup component add rustfmt + - name: install cargo-cache + if: steps.cache.outputs.cache-hit != 'true' + run: cargo install --locked cargo-cache --version 0.8.3 + - name: install cargo-sweep + if: steps.cache.outputs.cache-hit != 'true' + run: cargo install --locked cargo-sweep --version 0.7.0 - name: install dependencies if: steps.cache.outputs.cache-hit != 'true' run: sudo apt-get -y install postgresql git build-essential pkg-config autoconf automake libtool bison flex libpq-dev parallel libunwind-dev sed perl diff --git a/ci-build.sh b/ci-build.sh index 066eab0c76..570595da1b 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -128,11 +128,11 @@ export CCACHE_COMPRESSLEVEL=9 export CCACHE_MAXSIZE=500M export CCACHE_CPP2=true -# purge cache if it's too old +# periodically check to see if caches are old and purge them if so if [ -d "$CCACHE_DIR" ] ; then if [ -n "$(find $CCACHE_DIR -mtime +$CACHE_MAX_DAYS -print -quit)" ] ; then - echo Purging old cache $CCACHE_DIR - rm -rf $CCACHE_DIR + echo Purging old cache dirs $CCACHE_DIR $HOME/.cargo ./target + rm -rf $CCACHE_DIR $HOME/.cargo ./target fi fi @@ -163,6 +163,9 @@ date time make -j$(($NPROCS + 1)) ccache -s +### incrementally purge old content from cargo source cache and target directory +cargo cache trim --limit 100M +cargo sweep --maxsize 500MB if [ $WITH_TESTS -eq 0 ] ; then echo "Build done, skipping tests"