From c23559c4fd2a109976f46dda24d443b3232b0c64 Mon Sep 17 00:00:00 2001 From: Paul Woolcock Date: Fri, 24 Aug 2018 05:22:11 -0400 Subject: [PATCH] use cargo-tarpaulin to compute code coverage --- .travis.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 49fe7d2..3d6f521 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,30 @@ +sudo: required language: rust +dist: trusty +addons: + apt: + packages: + - libssl-dev +cache: cargo rust: - stable - beta - nightly before_script: - - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then rustup component add rustfmt-preview; fi' + - | + if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then rustup component add rustfmt-preview; fi script: - - bash -c 'if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then cargo fmt --all -- --check; fi' + - | + if [[ "$TRAVIS_RUST_VERSION" == "nightly"* ]]; then cargo fmt --all -- --check; fi - cargo build - cargo build --features toml - cargo build --features all - cargo test --features all +after_success: | + if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then + RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin + cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID + fi matrix: allow_failures: - rust: nightly