add codecov

This commit is contained in:
Denis S. Soldatov aka General-Beck 2018-01-17 00:14:38 +03:00
parent 12ebd901a5
commit c46887e90b
No known key found for this signature in database
GPG Key ID: 3E5771903C3EE2DE
2 changed files with 12 additions and 24 deletions

View File

@ -13,6 +13,7 @@ cache:
key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME" key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
paths: paths:
- target - target
- $HOME/.cargo
untracked: true untracked: true
linux-stable: linux-stable:
stage: build stage: build

View File

@ -12,34 +12,21 @@
### Running coverage ### Running coverage
set -x 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 $? RUSTFLAGS="-C link-dead-code" cargo test --all --exclude evmjit --no-run || exit $?
KCOV_TARGET="target/cov" KCOV_TARGET="target/cov"
KCOV_FLAGS="--verify" KCOV_FLAGS="--verify"
EXCLUDE="/usr/lib,\ EXCLUDE="/usr/lib,/usr/include,$HOME/.cargo,$HOME/.multirust,rocksdb,secp256k1"
/usr/include,\
$HOME/.cargo,\
$HOME/.multirust,\
rocksdb,\
secp256k1
"
rm -rf $KCOV_TARGET
mkdir -p $KCOV_TARGET mkdir -p $KCOV_TARGET
echo "Cover RUST" echo "Cover RUST"
for FILE in `find target/debug/deps ! -name "*.*"` for FILE in `find target/debug/deps ! -name "*.*"`
do do
timeout --signal=SIGKILL 10m $KCOV --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE timeout --signal=SIGKILL 5m kcov --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET $FILE
done done
timeout --signal=SIGKILL 5m kcov --coveralls-id=$COVERALLS_TOKEN --exclude-pattern $EXCLUDE $KCOV_FLAGS $KCOV_TARGET target/debug/parity-*
timeout --signal=SIGKILL 10m $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 exit 0