7 # Cache the global cargo directory, but NOT the local `target` directory which
8 # we cannot reuse anyway when the nightly changes (and it grows quite large
14 # Run in PRs and for bors, but not on master.
20 if: branch = auto OR branch = try OR type = pull_request OR type = cron
23 # Compute the Rust version we use. We do not use "language: rust" to have more control here.
25 if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
26 RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
28 RUSTC_HASH=$(cat rust-version)
30 # Install Rust. We use the "stable" toolchain for better caching, it is just used to build `rustup-toolchain-install-master`.
31 # But we also need to take into account that the build cache might have a different, outdated default.
32 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain none --profile minimal
33 - export PATH=$HOME/.cargo/bin:$PATH
34 - rustup default stable
35 - rustup toolchain uninstall beta nightly
37 # Install "master" toolchain.
38 - cargo install rustup-toolchain-install-master
39 - travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src -c rustc-dev -c llvm-tools
40 - rustup default master
48 # Don't cache "master" toolchain, it's a waste.
49 - rustup default stable
50 - rustup toolchain uninstall master
56 - post+travis@ralfj.de
57 - travis-miri@oli-obk.de