Skip to content

Commit

Permalink
Upload code coverage to codecov.io on gitlab build
Browse files Browse the repository at this point in the history
- Also fix source in $CARGO_HOME not being ignored for coverage purposes
on gitlab ci
  • Loading branch information
boustrophedon committed Feb 27, 2019
1 parent 30e3300 commit 49675d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ stages:
- apt-get update -yqq
# kcov build dependencies
- apt-get install -yqq --no-install-recommends build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev libelf-dev cmake gcc pkg-config jq
# Add cargo bin dir to path so we can check kcov version
- export PATH="$CARGO_HOME/bin:$PATH"

script:
- cargo kcov --version || cargo install cargo-kcov
Expand All @@ -43,4 +45,5 @@ stages:
[[ -x $CARGO_HOME/bin/kcov ]] && kcov --version | grep -q "$KCOV_VERSION" && echo "kcov bin found in cache"
|| cargo kcov --print-install-kcov-sh | sh
# sqlite3-sys outputs a bindgen file that kcov picks up, so we exclude it
- cargo kcov --verbose -- --exclude-pattern="bindgen.rs,$HOME/.cargo"
- cargo kcov --verbose -- --exclude-pattern="bindgen.rs,$CARGO_HOME"
- bash <(curl -s https://codecov.io/bash) && echo "Uploaded code coverage to codecov.io"

0 comments on commit 49675d0

Please sign in to comment.