From 71768bc0d2cfc08a58921ca2ed93ca901eff4a4d Mon Sep 17 00:00:00 2001 From: Masaharu TASHIRO Date: Mon, 21 Oct 2019 01:26:21 +0900 Subject: [PATCH] Use cache for kcov --- .travis.yml | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 596c4af..c014efa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,14 +11,33 @@ cache: directories: - $HOME/.cargo - $HOME/.rustup + - $HOME/kcov/ before_cache: - rm -rf /home/travis/.cargo/registry +env: + - PATH=$PATH:${HOME}/kcov/bin + jobs: allow_failures: - rust: nightly fast_finish: true +before_install: | + if [ ! -d "${HOME}/kcov/bin" ]; + then + wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && + tar xzf master.tar.gz && + cd kcov-master && + mkdir build && + cd build && + cmake -DCMAKE_INSTALL_PREFIX=${HOME}/kcov .. && + make && + make install && + cd ../.. && + rm -rf kcov-master; + fi + before_script: | cargo fmt --version cargo fmt -- --check @@ -37,16 +56,11 @@ addons: - libiberty-dev after_success: | - wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && - tar xzf master.tar.gz && - cd kcov-master && - mkdir build && - cd build && - cmake .. && - make && - make install DESTDIR=../../kcov-build && - cd ../.. && - rm -rf kcov-master && - for file in target/debug/fitting-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done && + for file in target/debug/fitting-*; + do + [ -x "${file}" ] || continue; + mkdir -p "target/cov/$(basename ${file})"; + kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename ${file})" "${file}"; + done && bash <(curl -s https://codecov.io/bash) && echo "Uploaded code coverage"