diff --git a/.travis.yml b/.travis.yml index bec2429be..e7ebb1027 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,5 @@ before_script: script: - go test -modfile=go_test.mod -v -run=TestNoRace -p=1 ./... --failfast -vet=off - if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then ./scripts/cov.sh TRAVIS; else go test -modfile=go_test.mod -race -v -p=1 ./... --failfast -vet=off; fi +after_success: +- if [[ "$TRAVIS_GO_VERSION" =~ 1.16 ]]; then $HOME/gopath/bin/goveralls -coverprofile=acc.out -service travis-ci; fi diff --git a/scripts/cov.sh b/scripts/cov.sh index f7057272a..f8f33db75 100755 --- a/scripts/cov.sh +++ b/scripts/cov.sh @@ -10,10 +10,9 @@ go test -modfile=go_test.mod --failfast -vet=off -v -race -covermode=atomic -cov gocovmerge ./cov/*.out > acc.out rm -rf ./cov -# If we have an arg, assume travis run and push to coveralls. Otherwise launch browser results -if [[ -n $1 ]]; then - $HOME/gopath/bin/goveralls -coverprofile=acc.out -service travis-ci - rm -rf ./acc.out -else +# Without argument, launch browser results. We are going to push to coveralls only +# from Travis.yml and after success of the build (and result of pushing will not affect +# build result). +if [[ $1 == "" ]]; then go tool cover -html=acc.out fi