Skip to content

Commit

Permalink
Speed-up build times
Browse files Browse the repository at this point in the history
- enable cache
- conditional build of ./depclose and ~/.local
- don't execute tests twice, directly collect coverage
  • Loading branch information
atodorov committed Jul 26, 2017
1 parent 8061392 commit 995fdff
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
46 changes: 33 additions & 13 deletions .travis.yml
Expand Up @@ -2,17 +2,30 @@ dist: trusty
language: rust
rust:
- nightly
cache:
cargo: true
directories:
- ./depclose
- ~/.local

before_install:
- sudo apt-get update
- virtualenv ./depclose
- source ./depclose/bin/activate
- pip install --upgrade pip
- pip install -r ./tests/depclose-integration/requirements.txt
# - sudo apt-get update
- |
if [ ! -f ./depclose/bin/python ]; then
virtualenv ./depclose
source ./depclose/bin/activate
pip install --upgrade pip
pip install -r ./tests/depclose-integration/requirements.txt
else
source ./depclose/bin/activate
fi
- |
LOCAL="~/.local" && export PATH=$LOCAL/bin:$PATH &&
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 ../..
if [ ! -f ~/.local/bin/kcov ]; then
LOCAL="~/.local" && export PATH=$LOCAL/bin:$PATH &&
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 ../..
fi
addons:
apt:
Expand All @@ -33,17 +46,24 @@ addons:
- libiberty-dev

script:
- make travis-ci
after_script:
- |
ls -l target/debug &&
make bdcs-api
make clippy
# NOTE: this will execute all tests and collect coverage
# we don't call make test b/c that executes the tests again
for file in target/debug/*-*; do
if [[ "${file: -2}" != ".d" ]]; then
mkdir -p "target/kcov/$(basename $file)";
kcov --include-path=./src --verify "target/kcov/$(basename $file)" "$file";
fi;
done &&
done
make depclose
after_script:
kcov --coveralls-id=$TRAVIS_JOB_ID --merge target/kcov target/kcov/*

notifications:
email:
on_failure: change
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Expand Up @@ -22,5 +22,3 @@ depclose: bdcs-api
wget https://s3.amazonaws.com/atodorov/metadata_centos7.db.gz
gunzip ./metadata_centos7.db.gz
METADATA_DB=`realpath ./metadata_centos7.db` make -C ./tests/depclose-integration/ test

travis-ci: test depclose

0 comments on commit 995fdff

Please sign in to comment.