From 501bfca1d1bb9e02971d79e87b0aefdb4adbe680 Mon Sep 17 00:00:00 2001 From: bochaco Date: Thu, 11 Apr 2019 15:12:18 -0300 Subject: [PATCH] test(coverage): try to use codecov.io instead --- .travis.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43af854..68a073d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,10 @@ addons: - libcurl4-openssl-dev - libelf-dev - libdw-dev - - binutils-dev # optional: only required for the --verify flag of coveralls + - cmake + - gcc + - binutils-dev + - libiberty-dev matrix: include: @@ -35,10 +38,7 @@ cache: before_script: - curl -sSL https://github.com/maidsafe/QA/raw/master/travis/cargo_install.sh > cargo_install.sh - bash cargo_install.sh cargo-prune; - - | - PKGNAME="safe_auth" # must match with cargo.toml - LOCAL="~/.local" # install here to avoid `sudo` - export PATH=$LOCAL/bin:$PATH + - PKGNAME="safe_auth" # must match with cargo.toml before_cache: - cargo prune @@ -54,10 +54,15 @@ after_success: if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && - cmake -DCMAKE_INSTALL_PREFIX:PATH=$LOCAL .. && make && - make install && cd ../.. && - kcov --verify \ - --coveralls-id=$TRAVIS_JOB_ID \ - --exclude-pattern=/.cargo \ - target/kcov target/debug/$PKGNAME-*; + cmake .. && make && + make install DESTDIR=../../kcov-build && cd ../.. && + rm -rf kcov-master && + for file in target/debug/$PKGNAME-*; do \ + [ -x "${file}" ] || continue; \ + echo "Calculating coverage of ${file}..." + mkdir -p "target/cov/$(basename $file)"; \ + ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; \ + done && + bash <(curl -s https://codecov.io/bash) -t 6bfd35b4-f75a-4e20-b656-f2a07838976f && + echo "Uploaded code coverage to codecov.io"; fi