rust/.travis.yml
2018-10-14 11:48:15 +02:00

75 lines
2.0 KiB
YAML

language: generic
cache:
# Cache the global cargo directory, but NOT the local `target` directory which
# we cannot reuse anyway when the nightly changes (and it grows quite large
# over time).
directories:
- /home/travis/.cargo
os:
- linux
- osx
before_script:
# mac os weirdness (https://github.com/travis-ci/travis-ci/issues/6307)
- rvm get stable
# Compute the rust version we use. We do not use "language: rust" to have more control here.
- |
if [ "$TRAVIS_EVENT_TYPE" = cron ]; then
RUST_TOOLCHAIN=nightly
else
RUST_TOOLCHAIN=$(cat rust-toolchain)
fi
- rm rust-toolchain
# install Rust
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
- export PATH=$HOME/.cargo/bin:$PATH
- rustc --version
# customize installation
- rustup target add i686-unknown-linux-gnu
- rustup target add i686-pc-windows-gnu
- rustup target add i686-pc-windows-msvc
- rustup component add rust-src
- cargo install xargo || echo "Skipping xargo install"
script:
- set -e
- |
# Test and install plain miri
cargo build --release --all-features &&
cargo test --release --all-features &&
cargo install --all-features --force --path .
- |
# get ourselves a MIR-full libstd
xargo/build.sh &&
export MIRI_SYSROOT=~/.xargo/HOST
- |
# run all tests with full mir
cargo test --release --all-features
- |
# test `cargo miri`
cd cargo-miri-test &&
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
cargo miri -q -- -Zmiri-start-fn
else
cargo miri -q -- -Zmiri-start-fn >stdout.real 2>stderr.real &&
cat stdout.real stderr.real &&
# Test `cargo miri` output. Not on mac because output redirecting doesn't
# work. There is no error. It just stops CI.
diff -u stdout.ref stdout.real &&
diff -u stderr.ref stderr.real
fi &&
# test `cargo miri test`
cargo miri test &&
cd ..
notifications:
email:
on_success: never
branches:
only:
- master
env:
global:
- RUST_TEST_NOCAPTURE=1