forked from facebookexperimental/MIRAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (51 loc) · 1.67 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
os:
- linux
- osx
# - windows
language: rust
rust:
- nightly-2020-10-06
before_install:
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then curl -L https://github.com/mozilla/grcov/releases/download/v0.5.9/grcov-osx-x86_64.tar.bz2 | tar jxf -; fi
before_script:
# install rustc-dev
- rustup component add rustc-dev
# install formatter
- rustup component add rustfmt
# install linter
- rustup component add clippy
# install llvm-tools
- rustup component add llvm-tools-preview
# install audit
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then cargo install cargo-audit; fi
# install z3
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then export RUSTFLAGS='-Clink-arg=-L./binaries -Clink-arg=-lstdc++'; fi
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then cp binaries/libz3.dylib /usr/local/lib; fi
script:
# Exit immediately if a command exits with a non-zero status.
- set -e
# Lint style checks
- |
if [ ${TRAVIS_OS_NAME} == "osx" ]
then
# Audit dependencies
cargo audit
# Run format checks
cargo fmt --all -- --check
# Run lint checks
cargo clippy -- -D warnings
fi
# Build
- cargo build
- if [ ${TRAVIS_OS_NAME} == "windows" ]; then cp binaries/libz3.dll target/debug; fi
# Run unit and integration tests
- RUST_BACKTRACE=1 cargo test
# Run code coverage tests
- |
if [ ${TRAVIS_OS_NAME} == "osx" ]
then
CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off" MIRAI_FLAGS=MIRAI_SINGLE cargo test --verbose
zip -0 ccov.zip `find . \( -name "mirai*.gc*" \) -print`
./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;
bash <(curl -s https://codecov.io/bash) -f lcov.info
fi