Skip to content

Commit bebb5bf

Browse files
committed
use rustup-toolchain-install-master for CI
1 parent 82f9a01 commit bebb5bf

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.travis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ cache:
55
# over time).
66
directories:
77
- /home/travis/.cargo
8+
- /home/travis/.rustup
89

910
os:
1011
- linux
@@ -17,18 +18,25 @@ before_script:
1718
# Compute the rust version we use. We do not use "language: rust" to have more control here.
1819
- |
1920
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
20-
RUST_TOOLCHAIN=nightly
21+
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
2122
else
22-
RUST_TOOLCHAIN=$(cat rust-version)
23+
RUSTC_HASH=$(cat rust-version)
2324
fi
2425
# install Rust
25-
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
26+
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain stable
2627
- export PATH=$HOME/.cargo/bin:$PATH
28+
- cargo install rustup-toolchain-install-master || echo "rustup-toolchain-install-master already installed"
29+
- rustup-toolchain-install-master -f -n master $RUSTC_HASH
30+
- rustup default master
2731
- rustc --version
2832

2933
script:
3034
- ./travis.sh
3135

36+
after_script:
37+
# Don't cache this, it's a waste
38+
- rustup toolchain uninstall master
39+
3240
notifications:
3341
email:
3442
on_success: never

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-04-03
1+
f717b58dd70829f105960a071c7992b440720482

0 commit comments

Comments
 (0)