circleci: Specify tarpaulin version
@@ -10,6 +10,7 @@ jobs:
RUST_BACKTRACE: "1"
RUSTFLAGS: "-Dwarnings"
FAIL_POINT: "1"
+ TARPAULIN_VERSION: "0.6.0"
steps:
- run:
name: Updating PATH and Define Environment Variable at Runtime
@@ -74,8 +75,13 @@ jobs:
- run:
name: Installing tarpaulin
command: |
- if [[ ! -e $HOME/.cargo/bin/cargo-tarpaulin ]]; then
- RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin;
+ RUST_TOOLCHAIN=`tail -n 1 RUST_VERSION`
+ CURRENT_TARPAULIN_VERSION=`cargo +${RUST_TOOLCHAIN} tarpaulin --version | awk '{ print $3 }'`
+ echo "Tarpaulin version is now: ${CURRENT_TARPAULIN_VERSION}"
+ echo "Tarpaulin version should be: ${TARPAULIN_VERSION}"
+ if [[ "${CURRENT_TARPAULIN_VERSION}" != "${TARPAULIN_VERSION}" ]]; then
+ # To understand why this Git is used please see https://github.com/pingcap/tikv/pull/3241#issuecomment-399768547
+ RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo +${RUST_TOOLCHAIN} install cargo-tarpaulin --git https://github.com/xd009642/tarpaulin --tag ${TARPAULIN_VERSION} --force
fi
- restore_cache:
name: Restoring ./target Cache
@@ -105,7 +111,8 @@ jobs:
- run:
name: Calculating code coverage
command: |
- cargo tarpaulin --no-count --skip-clean --out Xml
+ RUST_TOOLCHAIN=`tail -n 1 RUST_VERSION`
+ cargo +${RUST_TOOLCHAIN} tarpaulin --no-count --skip-clean --out Xml
bash <(curl -s https://codecov.io/bash)
no_output_timeout: 1800s
- save_cache:
