diff --git a/.travis.yml b/.travis.yml index 037ab49de2..c929ca3dcc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,7 @@ cache: cargo: true directories: - $HOME/.npm - # Set timeout to 6 minutes (double the default of 3 minutes) - timeout: 360 +before_cache: script/ci/prune-cache.sh env: global: @@ -27,7 +26,7 @@ env: - PERCY_PROJECT=crates-io/crates.io install: - - script/cargo-clean-on-new-rustc-version.sh + - script/ci/cargo-clean-on-new-rustc-version.sh - cargo install --force diesel_cli --vers `cat .diesel_version` --no-default-features --features postgres && export PATH=$HOME/.cargo/bin:$PATH before_script: @@ -53,22 +52,19 @@ matrix: - rust: stable before_install: - nvm install 10 + - npm ci - rustup component add rustfmt-preview - rustup component add clippy-preview script: - cargo fmt -- --check - cargo clippy --all-targets --all-features --all - - cargo build - cargo test - - npm install - npm test - rust: beta script: - - cargo build - cargo test - rust: nightly script: - - cargo build - cargo test notifications: diff --git a/script/cargo-clean-on-new-rustc-version.sh b/script/ci/cargo-clean-on-new-rustc-version.sh similarity index 100% rename from script/cargo-clean-on-new-rustc-version.sh rename to script/ci/cargo-clean-on-new-rustc-version.sh diff --git a/script/ci/prune-cache.sh b/script/ci/prune-cache.sh new file mode 100755 index 0000000000..852f9a0105 --- /dev/null +++ b/script/ci/prune-cache.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +echo "Initial cache size:" +du -hs target/debug + +crate_name="cargo-registry" +test_name="all" +bin_names="delete-crate delete-version populate render-readmes server test-pagerduty transfer-crates update-downloads" + +normalized_crate_name=${crate_name//-/_} +rm -v target/debug/$normalized_crate_name-* +rm -v target/debug/deps/$normalized_crate_name-* +rm -v target/debug/deps/lib$normalized_crate_name-* + +normalized_test_name=${test_name//-/_} +rm -v target/debug/$normalized_test_name-* +rm -v target/debug/deps/$normalized_test_name-* + +for name in $bin_names; do + rm -v target/debug/$name + normalized=${name//-/_} + rm -v target/debug/$normalized-* + rm -v target/debug/deps/$normalized-* +done + +echo "Final cache size:" +du -hs target/debug