From 5998ef73fbe64550551a795e3972aa3f73cfdf92 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Wed, 26 Aug 2020 13:10:03 -0400 Subject: [PATCH] Take 3, a potential fix for CI/CD issues. --- .travis.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 58c86d6b..1de594c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,36 @@ language: rust -cache: cargo # cache cargo-audit once installed +env: + - CARGO_INCREMENTAL=0 +# https://bheisler.github.io/post/efficient-use-of-travis-ci-cache-for-rust/ +before_cache: + # Delete loose files in the debug directory + - find ./target/debug -maxdepth 1 -type f -delete + # Delete the test and benchmark executables. Finding these all might take some + # experimentation. + - rm -rf ./target/debug/deps/criterion* + - rm -rf ./target/debug/deps/bench* + # Delete the associated metadata files for those executables + - rm -rf ./target/debug/.fingerprint/criterion* + - rm -rf ./target/debug/.fingerprint/bench* + # Note that all of the above need to be repeated for `release/` instead of + # `debug/` if your build script builds artifacts in release mode. + # This is just more metadata + - rm -f ./target/.rustc_info.json + # Also delete the saved benchmark data from the test benchmarks. If you + # have Criterion.rs benchmarks, you'll probably want to do this as well, or set + # the CRITERION_HOME environment variable to move that data out of the + # `target/` directory. + - rm -rf ./target/criterion + # Also delete cargo's registry index. This is updated on every build, but it's + # way cheaper to re-download than the whole cache is. + - rm -rf "$TRAVIS_HOME/.cargo/registry/index/" + - rm -rf "$TRAVIS_HOME/.cargo/registry/src" +cache: + directories: + - ./target + - $TRAVIS_HOME/.cache/sccache + - $TRAVIS_HOME/.cargo/ + - $TRAVIS_HOME/.rustup/ before_script: - cargo install --force cargo-audit - cargo generate-lockfile