rust/.travis.yml

62 lines
1.7 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:
# macOS weirdness (https://github.com/travis-ci/travis-ci/issues/6307, https://github.com/travis-ci/travis-ci/issues/10165)
- if [[ "$TRAVIS_OS_NAME" == osx ]]; then rvm get stable; fi
# 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-version)
fi
- |
if [ "$TRAVIS_OS_NAME" == osx ]; then
export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
else
export MIRI_SYSROOT_BASE=~/.cache/miri/HOST
fi
# 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
script:
- set -e
- |
# Build and install miri
cargo build --release --all-features --all-targets &&
cargo install --all-features --force --path .
- |
# Get ourselves a MIR-full libstd
cargo miri setup &&
cargo miri setup --target i686-unknown-linux-gnu &&
cargo miri setup --target i686-apple-darwin
- |
# Test miri with full MIR, on the host and other architectures
MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features &&
MIRI_SYSROOT=$MIRI_SYSROOT_BASE cargo test --release --all-features
- |
# Test cargo integration
(cd test-cargo-miri && MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST ./run-test.py)
notifications:
email:
on_success: never
branches:
only:
- master
env:
global:
- RUST_TEST_NOCAPTURE=1