Skip to content

Commit

Permalink
Set up code coverage monitoring with codecov.io.
Browse files Browse the repository at this point in the history
Lots of hoops to jump through to get this to actually work.
  • Loading branch information
pkgw committed Jan 23, 2018
1 parent 00b8d8a commit afa15e9
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
language: rust

cache: cargo
sudo: true

matrix:
include:
- os: linux
sudo: required
dist: xenial
rust: stable
env: RUSTFLAGS="-C link-dead-code"
- os: linux
sudo: required
dist: xenial
rust: beta
- os: linux
sudo: required
dist: xenial
rust: nightly
- os: osx
Expand All @@ -31,15 +34,27 @@ addons:
- libharfbuzz-dev
- libfontconfig1-dev
- libicu-dev
- zlib1g-dev
- libssl-dev
- openssl
- zlib1g-dev

# At the moment, Travis' Xenial images have an auto-update daemon that can
# lock the apt/dpkg system under us. See
# https://github.com/travis-ci/travis-cookbooks/issues/952 and
# https://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image
# . We adopt the workaround from the StackExchange post.

before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
else
sudo add-apt-repository -y ppa:k-peter/tectonic-ci
sudo systemctl stop apt-daily.service &&
sudo systemctl kill --kill-who=all apt-daily.service &&
while ! (systemctl list-units --all apt-daily.service | fgrep -q dead) ; do
sleep 1
done &&
sudo add-apt-repository -y ppa:k-peter/tectonic-ci &&
sudo apt-get update
fi
Expand All @@ -50,7 +65,7 @@ install:
brew install harfbuzz --with-graphite2 &&
brew install --force openssl
else
sudo apt-get upgrade -y libharfbuzz-dev
sudo apt-get install -y libharfbuzz-dev
fi
before_script:
Expand All @@ -67,6 +82,18 @@ script:
cargo build --verbose &&
cargo test
after_success: |
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_RUST_VERSION" == "stable" ]]; then
sudo apt-get install -y kcov &&
cargo install cargo-kcov &&
for testfile in tests/*.rs ; do
test=$(basename $testfile .rs) &&
[[ "$test" = executable ]] ||
cargo kcov -v --no-clean-rebuild --test $test -- --verify --include-path=$(pwd)
done &&
bash <(curl -s https://codecov.io/bash)
fi
before_deploy:
- openssl aes-256-cbc -K $encrypted_bc40b17e21fa_key -iv $encrypted_bc40b17e21fa_iv
-in dist/deploy_key.enc -out /tmp/deploy_key -d
Expand Down

0 comments on commit afa15e9

Please sign in to comment.