From 4a8ed5be5cc4f33ca582f20446fdd2487ec165dd Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 10 Jan 2020 10:00:05 +0900 Subject: [PATCH] Enable codecov Change-Id: Ib3ecabe823de8a18110e4c54ac74af6df37f25c5 --- .travis.yml | 15 ++++++++------- go.test.sh | 12 ++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) create mode 100755 go.test.sh diff --git a/.travis.yml b/.travis.yml index 5597e02..604314d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,14 @@ language: go +sudo: false go: + - 1.13.x - tip -os: - - linux - - osx - before_install: - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover + - go get -t -v ./... + script: - - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5 + - ./go.test.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/go.test.sh b/go.test.sh new file mode 100755 index 0000000..012162b --- /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