]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Merge pull request #464 from RalfJung/travis
[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
13 before_script:
14 # mac os weirdness (https://github.com/travis-ci/travis-ci/issues/6307)
15 - rvm get stable
16 # Compute the rust version we use. We do not use "language: rust" to have more control here.
17 - |
18   if [ "$TRAVIS_EVENT_TYPE" = cron ]; then
19     RUST_TOOLCHAIN=nightly
20   else
21     RUST_TOOLCHAIN=$(cat rust-toolchain)
22   fi
23 - rm rust-toolchain
24 # install Rust
25 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
26 - export PATH=$HOME/.cargo/bin:$PATH
27 - rustc --version
28 # customize installation
29 - rustup target add i686-unknown-linux-gnu
30 - rustup target add i686-pc-windows-gnu
31 - rustup target add i686-pc-windows-msvc
32 - rustup component add rust-src
33 - cargo install xargo || echo "Skipping xargo install"
34
35 script:
36 - set -e
37 - |
38   # Test and install plain miri
39   cargo build --release --all-features &&
40   cargo test --release --all-features &&
41   cargo install --all-features --force --path .
42 - |
43   # test that the rustc_tests binary compiles
44   cd rustc_tests &&
45   cargo build --release &&
46   cd ..
47 - |
48   # get ourselves a MIR-full libstd
49   xargo/build.sh &&
50   export MIRI_SYSROOT=~/.xargo/HOST
51 - |
52   # run all tests with full mir
53   cargo test --release --all-features
54 - |
55   # test `cargo miri`
56   cd cargo-miri-test &&
57   if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
58     cargo miri -q -- -Zmiri-start-fn
59   else
60     cargo miri -q -- -Zmiri-start-fn >stdout.real 2>stderr.real &&
61     cat stdout.real stderr.real &&
62     # Test `cargo miri` output. Not on mac because output redirecting doesn't
63     # work. There is no error. It just stops CI.
64     diff -u stdout.ref stdout.real &&
65     diff -u stderr.ref stderr.real
66   fi &&
67   # test `cargo miri test`
68   cargo miri test &&
69   cd ..
70
71 notifications:
72   email:
73     on_success: never
74 branches:
75   only:
76   - master
77 env:
78   global:
79   - RUST_TEST_NOCAPTURE=1