ci: clean up tarpaulin script

This commit is contained in:
Trevor Spiteri 2020-04-18 00:10:01 +02:00
parent f8f9bd69ba
commit 8c6a36bf39
1 changed files with 3 additions and 8 deletions

View File

@ -88,19 +88,14 @@ i686-gnulinux:
x86_64-gnulinux-tarpaulin:
image: amd64/rust:1
variables:
TARGET: x86_64
REQ_COVERAGE: "86.2"
cache:
key: $CI_JOB_NAME
paths:
- cargo/
script:
- if [ -d cargo/registry/cache ]; then rm -rf $CARGO_HOME/registry/cache; mkdir -p $CARGO_HOME/registry; cp -R cargo/registry/cache $CARGO_HOME/registry/; echo Copied registry/cache; fi
- if [ -d $CARGO_HOME/registry/cache ]; then (cd $CARGO_HOME/registry; find cache -name \*.crate) fi
- cargo install --version 0.12.3 --locked cargo-tarpaulin
- stdbuf -oL cargo tarpaulin -v --ignore-tests --exclude-files build.rs --features "az f16 serde std" | tee tarpaulin.log
- cargo +beta-$TARGET install --version 0.12.3 --locked cargo-tarpaulin
- stdbuf -oL cargo +beta-$TARGET tarpaulin -v --ignore-tests --exclude-files build.rs --features "az f16 serde std" | tee tarpaulin.log
- echo "Check that coverage not less than $REQ_COVERAGE%"
- tail -1 tarpaulin.log | awk '{ if ($1 < '$REQ_COVERAGE') { exit 1 } }'
- if [ -d $CARGO_HOME/registry/cache ]; then (cd $CARGO_HOME/registry; find cache -name \*.crate) fi
- rm -rf cargo
- mkdir -p cargo/registry
- if [ -d $CARGO_HOME/registry/cache ]; then cp -R $CARGO_HOME/registry/cache cargo/registry/; echo Updated registry/cache; fi