-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.travis.yml
42 lines (37 loc) · 1.11 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
language: rust
rust:
- stable
- nightly
matrix:
allow_failures:
- rust: nightly
# Test coverage (with Tarpaulin)
- env: TARPAULIN_VERSION="0.6.2"
rust: stable
install:
- RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin --version $TARPAULIN_VERSION
script:
- cargo tarpaulin --verbose > ./tarpaulin.out
# Fetch coverage percentage (integer)
- COVERAGE=$(cat ./tarpaulin.out | awk -F '.' '/coverage/ { print $1 }')
- echo COVERAGE=${COVERAGE}
# Print uncoverted lines
- 'echo "UNCOVERED LINES" && grep "hits: 0" ./tarpaulin.out'
# Exit 1, if coverage is less than 89%
- if [ $COVERAGE -lt 89 ]; then exit 0; fi
install:
- rustup component add rustfmt-preview
- rustup component add clippy-preview
script:
- cargo fmt -- --check
- touch ./src/lib.rs && cargo clippy -- -D warnings
- cargo test
cache:
cargo: true
before_cache:
# Travis can't cache files that are not readable by "others"
- chmod -R a+r $HOME/.cargo
addons:
apt:
packages:
- libssl-dev # Required for tarpaulin