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
---
language: rust
dist: trusty
sudo: required
matrix:
include:
# minimal supported Rust version
- rust: 1.32.0
- rust: stable
- rust: beta
- rust: nightly
addons:
apt:
packages:
# cargo-tarpaulin needs this
- libssl-dev
install:
# For test coverage. In install step so that it can use cache.
- cargo tarpaulin --version || RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin
allow_failures:
- rust: nightly
cache: cargo
script:
- 'if [[ "$TRAVIS_RUST_VERSION" = 1.32.0 ]]; then cargo rustc -- -D warnings; fi'
- cargo build --verbose
- cargo test --verbose
- 'if [[ "$TRAVIS_RUST_VERSION" = nightly ]]; then cargo bench; fi'
after_success: |
if [[ "$TRAVIS_RUST_VERSION" = nightly ]]; then
# Calculate test coverage
cargo tarpaulin --out Xml
bash <(curl -s https://codecov.io/bash)
fi