]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Merge pull request #492 from solson/rustup
[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-version)
22   fi
23 # install Rust
24 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
25 - export PATH=$HOME/.cargo/bin:$PATH
26 - rustc --version
27 # customize installation
28 - rustup target add i686-unknown-linux-gnu
29 - rustup target add i686-pc-windows-gnu
30 - rustup target add i686-pc-windows-msvc
31 - rustup component add rust-src
32 - cargo install xargo || echo "Skipping xargo install"
33
34 script:
35 - set -e
36 - |
37   # Test and install plain miri
38   cargo build --release --all-features &&
39   #cargo test --release --all-features &&
40   cargo install --all-features --force --path .
41 - |
42   # get ourselves a MIR-full libstd
43   xargo/build.sh &&
44   export MIRI_SYSROOT=~/.xargo/HOST
45 #- |
46 #  # run all tests with full mir
47 #  cargo test --release --all-features
48 - |
49   # Test cargo integration
50   cd cargo-miri-test &&
51   # Test `cargo miri`
52     # We ignore the exit code because we want to see the output even on failure, and
53     # I found no way to preserve the exit code so that we can test for it later.
54     # Variables set in this subshell in the parenthesis are not available
55     # on the outside.
56     # We assume that if this fails, it'll also print something about the failure on
57     # stdout/stderr and we'll catch that.
58     # FIXME: Disabling validation, still investigating whether there is UB here
59     (cargo miri -q >stdout.real 2>stderr.real -- -Zmiri-disable-validation || true) &&
60     # Print file names and contents (`cat` would just print contents)
61     tail -n +0 stdout.real stderr.real &&
62     # Verify output
63     diff -u stdout.ref stdout.real &&
64     diff -u stderr.ref stderr.real &&
65   # test `cargo miri test`
66     cargo miri test &&
67   cd ..
68
69 notifications:
70   email:
71     on_success: never
72 branches:
73   only:
74   - master
75 env:
76   global:
77   - RUST_TEST_NOCAPTURE=1