Skip to content

Commit 2d416cb

Browse files
committed
Auto merge of #4659 - lzutao:caching, r=<try>
Cache cargo binaries changelog: none
2 parents 07c0673 + d81191e commit 2d416cb

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.travis.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ branches:
1313
- trying.tmp
1414
- staging.tmp
1515

16+
cache:
17+
directories:
18+
- $HOME/.cargo
19+
before_cache:
20+
- cargo install -Z install-upgrade cargo-cache --debug
21+
- cargo cache --autoclean
22+
1623
env:
1724
global:
1825
- RUST_BACKTRACE=1
@@ -23,8 +30,10 @@ before_install:
2330
- export PATH="$HOME/.cargo/bin:$PATH"
2431
install:
2532
- |
26-
if [ -z ${INTEGRATION} ]; then
27-
rustup component add rustfmt || cargo install --git https://github.com/rust-lang/rustfmt/ --force
33+
if [[ -z ${INTEGRATION} ]]; then
34+
if ! rustup component add rustfmt; then
35+
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
36+
fi
2837
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
2938
. $HOME/.nvm/nvm.sh
3039
nvm install stable

appveyor.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ branches:
1313
- auto
1414
- try
1515

16+
cache:
17+
- '%USERPROFILE%\.cargo'
18+
on_finish:
19+
- cargo install -Z install-upgrade cargo-cache --debug
20+
- cargo cache --autoclean
21+
1622
install:
1723
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
1824
- rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly --profile=minimal
1925
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
2026
- del rust-toolchain
21-
- cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
27+
- cargo install -Z install-upgrade rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
2228
- rustup-toolchain-install-master -f -n master
2329
- rustup component add rustfmt --toolchain nightly & exit 0 # Format test handles missing rustfmt
2430
- rustup default master

setup-toolchain.sh

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cd "$(dirname "$0")" || exit
77

88
if ! command -v rustup-toolchain-install-master > /dev/null; then
99
cargo install \
10+
-Z install-upgrade \
1011
rustup-toolchain-install-master \
1112
--bin rustup-toolchain-install-master \
1213
--debug

0 commit comments

Comments
 (0)