From 00b3d9cf867f187018f0a94d33a03f5ea791537e Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Fri, 21 Jun 2019 12:06:51 +0700 Subject: [PATCH 1/3] build: Fix broken cache by updating sccache --- .travis.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 840f92c1..bc0e9430 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,26 +27,28 @@ matrix: env: TARGET=x86_64-apple-darwin before_install: - - export SCCACHE_VER=0.2.8 RUSTC_WRAPPER=sccache - - case "$TRAVIS_OS_NAME" in + - | + export RUSTC_WRAPPER=sccache; + cd "$(mktemp -d)"; + case "$TRAVIS_OS_NAME" in linux ) - cd /tmp - && travis_retry curl -sSL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VER}/sccache-${SCCACHE_VER}-x86_64-unknown-linux-musl.tar.gz" | tar xzf - - && sudo mv "sccache-${SCCACHE_VER}-x86_64-unknown-linux-musl/sccache" /usr/local/bin/sccache; + travis_retry curl -sSL 'https://github.com/mozilla/sccache/releases/download/0.2.9/sccache-0.2.9-x86_64-unknown-linux-musl.tar.gz' | tar -xzf - --strip-components=1 && + sudo cp sccache /usr/local/bin/sccache; ;; osx ) - cd "${TMPDIR}" - && travis_retry curl -sSL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VER}/sccache-${SCCACHE_VER}-x86_64-apple-darwin.tar.gz" | tar xzf - - && sudo mv "sccache-${SCCACHE_VER}-x86_64-apple-darwin/sccache" /usr/local/bin/sccache; + travis_retry curl -sSL 'https://github.com/mozilla/sccache/releases/download/0.2.9/sccache-0.2.9-x86_64-apple-darwin.tar.gz' | tar -xzf - --strip-components=1 && + sudo cp sccache /usr/local/bin/sccache; ;; * ) unset RUSTC_WRAPPER;; - esac - - cd "$TRAVIS_BUILD_DIR" + esac; + cd "$TRAVIS_BUILD_DIR"; script: - cargo test --all - cargo test --all --no-default-features - - if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then + - | + sh -ex; + if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then rustup component add rustfmt; rustfmt -vV; cargo fmt --all -- --check; From 1ce14012636e5e685c69a25a7ef76fabeb24fbe5 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Fri, 28 Jun 2019 11:07:54 +0700 Subject: [PATCH 2/3] travis: Include cargo registry when cache This reduces the crates downloading time upto 30 seconds on fast network. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc0e9430..bb604074 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,6 @@ cache: directories: - "$HOME/.cargo" - "$HOME/.cache/sccache" -before_cache: - - rm -rf "$HOME/.cargo/registry" env: global: From ba41d73dc38f1ce80722dac4e4778c18e0118db2 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Fri, 28 Jun 2019 23:14:26 +0700 Subject: [PATCH 3/3] build: Fix stale builds --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bb604074..dbe44b21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,10 +45,8 @@ script: - cargo test --all - cargo test --all --no-default-features - | - sh -ex; if [ "$TARGET" = x86_64-unknown-linux-gnu ] && [ "$TRAVIS_RUST_VERSION" = stable ]; then - rustup component add rustfmt; - rustfmt -vV; + rustup component add rustfmt && \ cargo fmt --all -- --check; fi