diff options
author | insomniac <insomniacslk@users.noreply.github.com> | 2018-05-06 15:18:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-06 15:18:30 +0200 |
commit | 94cb7f39d4813bfd059ccd990f239124525ef564 (patch) | |
tree | 686a39e7099ae82c2691b06c860b471edae9e643 | |
parent | 5edf6e397b1f3ad5fff322bd59364d2a1a992d6d (diff) |
Added code coverage via Codecov (#60)
-rw-r--r-- | .travis.yml | 9 | ||||
-rwxr-xr-x | .travis/tests.sh | 15 |
2 files changed, 23 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml index bb1de30..142bea8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,5 +8,12 @@ go: - "1.10" - tip +before_install: + - go get -t -v ./... + script: - - go test -v -race $(go list ./...) + - ./.travis/tests.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) + diff --git a/.travis/tests.sh b/.travis/tests.sh new file mode 100755 index 0000000..ce77be6 --- /dev/null +++ b/.travis/tests.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# because things are never simple. +# See https://github.com/codecov/example-go#caveat-multiple-files + +set -e +echo "" > coverage.txt + +for d in $(go list ./... | grep -v vendor); do + go test -race -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done |