diff --git a/circle.yml b/circle.yml index 8e3ad168b..3dba976be 100644 --- a/circle.yml +++ b/circle.yml @@ -1,11 +1,9 @@ machine: environment: - GOPATH: /home/ubuntu/.go_workspace + GOPATH: "${HOME}/.go_workspace" PROJECT_PARENT_PATH: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME" PROJECT_PATH: $GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME - GO15VENDOREXPERIMENT: 1 hosts: - circlehost: 127.0.0.1 localhost: 127.0.0.1 dependencies: @@ -17,5 +15,7 @@ dependencies: test: override: - - "go version" - - "cd $PROJECT_PATH && make get_vendor_deps && make metalinter_test && make test" + - cd $PROJECT_PATH && make get_vendor_deps && make metalinter_test && bash ./test.sh + post: + - cd "$PROJECT_PATH" && bash <(curl -s https://codecov.io/bash) -f coverage.txt + - cd "$PROJECT_PATH" && mv coverage.txt "${CIRCLE_ARTIFACTS}" diff --git a/test.sh b/test.sh new file mode 100755 index 000000000..012162b07 --- /dev/null +++ b/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