From c46887e90b6e0a7f71bc826ec8d6707dfad3ede2 Mon Sep 17 00:00:00 2001 From: "Denis S. Soldatov aka General-Beck" Date: Wed, 17 Jan 2018 00:14:38 +0300 Subject: [PATCH] add codecov --- .gitlab-ci.yml | 1 + scripts/cov.sh | 35 +++++++++++------------------------ 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b90e60c46..298200de7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ cache: key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME" paths: - target + - $HOME/.cargo untracked: true linux-stable: stage: build diff --git a/scripts/cov.sh b/scripts/cov.sh index 2c9038c27..828a5dd4b 100755 --- a/scripts/cov.sh +++ b/scripts/cov.sh @@ -12,34 +12,21 @@ ### Running coverage set -x - -KCOV=${1:-kcov} - -if ! type $KCOV > /dev/null; then - echo "Install kcov first (details inside this file). Aborting." - exit 1 -fi - RUSTFLAGS="-C link-dead-code" cargo test --all --exclude evmjit --no-run || exit $? - - KCOV_TARGET="target/cov" KCOV_FLAGS="--verify" -EXCLUDE="/usr/lib,\ -/usr/include,\ -$HOME/.cargo,\ -$HOME/.multirust,\ -rocksdb,\ -secp256k1 -" - -rm -rf $KCOV_TARGET +EXCLUDE="/usr/lib,/usr/include,$HOME/.cargo,$HOME/.multirust,rocksdb,secp256k1" mkdir -p $KCOV_TARGET echo "Cover RUST" for FILE in `find target/debug/deps ! -name "*.*"` -do - timeout --signal=SIGKILL 10m $KCOV --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE -done - -timeout --signal=SIGKILL 10m $KCOV --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* + do + timeout --signal=SIGKILL 5m kcov --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE + done +timeout --signal=SIGKILL 5m kcov --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-* +echo "Cover JS" +cd js +npm install&&npm run test:coverage +cd .. +bash <(curl -s https://codecov.io/bash)&& +echo "Uploaded code coverage" exit 0