Auto merge of #4659 - lzutao:caching, r=phansch

Cache cargo binaries

changelog: none
This commit is contained in:
bors 2019-10-17 17:16:36 +00:00
commit 4a388e1fd5
3 changed files with 19 additions and 3 deletions

View file

@ -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
@ -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

View file

@ -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

View file

@ -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