Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add codecov integration #391

Merged
merged 1 commit into from
Mar 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ vendor
*.swo
*.db
default.etcd/
coverage.txt
profile.out
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ script:
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install --force
- gometalinter --vendor --fast --disable=gotype --disable=vetshadow --disable=gas --skip=mock ./...
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then go test ./...; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then go get github.com/mattn/goveralls; fi'
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then goveralls -race -service=travis-ci -ignore=./mock/*,./*/mock/*,./*/*/mock/*; fi'
- ./codecov.sh
- go test ./tests -tags=integration
after_success:
- test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash
- bash <(curl -s https://codecov.io/bash)
notifications:
email:
- [email protected]
12 changes: 12 additions & 0 deletions codecov.sh
Original file line number Diff line number Diff line change
@@ -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