Browse Source

add codecov

pull/1842/head
Anton Kaliaev 7 years ago
parent
commit
f99c73502c
No known key found for this signature in database GPG Key ID: 7B6881D965918214
2 changed files with 17 additions and 5 deletions
  1. +5
    -5
      circle.yml
  2. +12
    -0
      test.sh

+ 5
- 5
circle.yml View File

@ -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}"

+ 12
- 0
test.sh View File

@ -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

Loading…
Cancel
Save