diff --git a/.gitignore b/.gitignore index a07071a..3afed1e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ vendor *.swo *.db default.etcd/ +coverage.txt +profile.out diff --git a/.travis.yml b/.travis.yml index ca6f051..20c5408 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,12 +13,11 @@ script: - go get -u github.com/alecthomas/gometalinter - gometalinter --install --force - gometalinter --vendor --fast --disable=gotype --disable=vetshadow --disable=gas --skip=mock ./... -- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then go test ./...; fi' -- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then go get github.com/mattn/goveralls; fi' -- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then goveralls -race -service=travis-ci -ignore=./mock/*,./*/mock/*,./*/*/mock/*; fi' +- ./codecov.sh - go test ./tests -tags=integration after_success: - test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash +- bash <(curl -s https://codecov.io/bash) notifications: email: - platform@serverless.com diff --git a/codecov.sh b/codecov.sh new file mode 100755 index 0000000..80d33f9 --- /dev/null +++ b/codecov.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +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 \ No newline at end of file