]> git.lizzy.rs Git - rust.git/blob - .travis.yml
fix CI
[rust.git] / .travis.yml
1 language: generic
2 cache:
3   # Cache the global cargo directory, but NOT the local `target` directory which
4   # we cannot reuse anyway when the nightly changes (and it grows quite large
5   # over time).
6   directories:
7     - /home/travis/.cargo
8
9 os:
10 - linux
11 - osx
12 dist: xenial
13
14 before_script:
15 # install extra stuff for cross-compilation
16 - if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt update && sudo apt install gcc-multilib; fi
17 # macOS weirdness (https://github.com/travis-ci/travis-ci/issues/6307, https://github.com/travis-ci/travis-ci/issues/10165)
18 - if [[ "$TRAVIS_OS_NAME" == osx ]]; then rvm get stable; fi
19 # Compute the rust version we use. We do not use "language: rust" to have more control here.
20 - |
21   if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
22     RUST_TOOLCHAIN=nightly
23   else
24     RUST_TOOLCHAIN=$(cat rust-version)
25   fi
26 - |
27   if [ "$TRAVIS_OS_NAME" == osx ]; then
28     export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
29   else
30     export MIRI_SYSROOT_BASE=~/.cache/miri/
31   fi
32 # install Rust
33 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
34 - export PATH=$HOME/.cargo/bin:$PATH
35 - rustc --version
36
37 script:
38 - set -e
39 - |
40   # Build and install miri
41   cargo build --release --all-features --all-targets &&
42   cargo install --all-features --force --path .
43 - |
44   # Get ourselves a MIR-full libstd for the host and a foreign architecture
45   cargo miri setup &&
46   if [[ "$TRAVIS_OS_NAME" == osx ]]; then
47     cargo miri setup --target i686-apple-darwin
48   else
49     cargo miri setup --target i686-unknown-linux-gnu
50   fi
51 - |
52   # Test miri with full MIR, on the host and other architectures
53   MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features &&
54   MIRI_SYSROOT=$MIRI_SYSROOT_BASE cargo test --release --all-features
55 - |
56   # Test cargo integration
57   (cd test-cargo-miri && MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST ./run-test.py)
58
59 notifications:
60   email:
61     on_success: never
62 branches:
63   only:
64   - master
65 env:
66   global:
67   - RUST_TEST_NOCAPTURE=1