forked from facebookexperimental/MIRAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
59 lines (52 loc) · 1.62 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
59
os:
- linux
- osx
# - windows
language: rust
rust:
- nightly-2020-02-27
before_install:
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then curl -L https://github.com/mozilla/grcov/releases/download/v0.4.3/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 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
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads"
cargo build
cargo test
zip -0 ccov.zip `find . \( -name "mirai*.gc*" \) -print`
./grcov ccov.zip --ignore-not-existing --llvm --ignore-dir "/*" -t lcov > lcov.info
bash <(curl -s https://codecov.io/bash) -f lcov.info
fi