Skip to content

Commit

Permalink
Auto merge of #4659 - lzutao:caching, r=<try>
Browse files Browse the repository at this point in the history
Cache cargo binaries

changelog: none
  • Loading branch information
bors committed Oct 17, 2019
2 parents 07c0673 + d81191e commit 011e46b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ branches:
- trying.tmp
- staging.tmp

cache:
directories:
- $HOME/.cargo
before_cache:
- cargo install -Z install-upgrade cargo-cache --debug
- cargo cache --autoclean

env:
global:
- RUST_BACKTRACE=1
Expand All @@ -23,8 +30,10 @@ before_install:
- export PATH="$HOME/.cargo/bin:$PATH"
install:
- |
if [ -z ${INTEGRATION} ]; then
rustup component add rustfmt || cargo install --git https://github.com/rust-lang/rustfmt/ --force
if [[ -z ${INTEGRATION} ]]; then
if ! rustup component add rustfmt; then
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
fi
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
. $HOME/.nvm/nvm.sh
nvm install stable
Expand Down
8 changes: 7 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ branches:
- auto
- try

cache:
- '%USERPROFILE%\.cargo'
on_finish:
- cargo install -Z install-upgrade cargo-cache --debug
- cargo cache --autoclean

install:
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly --profile=minimal
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- del rust-toolchain
- cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
- cargo install -Z install-upgrade rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
- rustup-toolchain-install-master -f -n master
- rustup component add rustfmt --toolchain nightly & exit 0 # Format test handles missing rustfmt
- rustup default master
Expand Down
1 change: 1 addition & 0 deletions setup-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cd "$(dirname "$0")" || exit

if ! command -v rustup-toolchain-install-master > /dev/null; then
cargo install \
-Z install-upgrade \
rustup-toolchain-install-master \
--bin rustup-toolchain-install-master \
--debug
Expand Down

0 comments on commit 011e46b

Please sign in to comment.