Skip to content

Commit 26ea2ca

Browse files
Thom Chiovolonimbrubeck
Thom Chiovoloni
authored andcommitted
Run miri in CI
1 parent e64afc8 commit 26ea2ca

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ script: |
1111
([ $TRAVIS_RUST_VERSION != nightly ] || cargo check --verbose --no-default-features) &&
1212
([ $TRAVIS_RUST_VERSION != nightly ] || cargo test --verbose --features union) &&
1313
([ $TRAVIS_RUST_VERSION != nightly ] || cargo test --verbose --all-features) &&
14-
([ $TRAVIS_RUST_VERSION != nightly ] || cargo bench --verbose bench)
14+
([ $TRAVIS_RUST_VERSION != nightly ] || cargo bench --verbose bench) &&
15+
([ $TRAVIS_RUST_VERSION != nightly ] || bash ./scripts/run_miri.sh)

scripts/run_miri.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/bash
2+
3+
set -ex
4+
5+
# Clean out our target dir, which may have artifacts compiled by a version of
6+
# rust different from the one we're about to download.
7+
cargo clean
8+
9+
# Install and run the latest version of nightly where miri built successfully.
10+
# Taken from: https://github.com/rust-lang/miri#running-miri-on-ci
11+
12+
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
13+
echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
14+
rustup default "$MIRI_NIGHTLY"
15+
16+
rustup component add miri
17+
cargo miri setup
18+
19+
cargo miri test --verbose -- -- -Zunstable-options --exclude-should-panic
20+
cargo miri test --verbose --features union -- -- -Zunstable-options --exclude-should-panic
21+
cargo miri test --verbose --all-features -- -- -Zunstable-options --exclude-should-panic

0 commit comments

Comments
 (0)