From 1f9a92d5663027a49bea75bed6b5a842412661cc Mon Sep 17 00:00:00 2001 From: Gabriel Ochsenhofer Date: Wed, 27 Feb 2019 19:02:33 -0300 Subject: [PATCH] added codecov --- .travis.yml | 6 +++++- go.test.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 go.test.sh diff --git a/.travis.yml b/.travis.yml index e0a4f22..5ca7558 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,8 @@ before_install: script: - go test -v -covermode=count -coverprofile=coverage.out ./... - - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN \ No newline at end of file + - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN + - go test -race -coverprofile=coverage.txt -covermode=atomic + +after_success: + - bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/go.test.sh b/go.test.sh new file mode 100755 index 0000000..7141c0d --- /dev/null +++ b/go.test.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