Skip to content

Commit

Permalink
Add a check for baseline test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 12, 2020
1 parent 58b8551 commit ea85544
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ script:
after_success:
- |
set -e
if [[ "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_PULL_REQUEST" == "false" && -n "$COVERALLS_TOKEN" ]]
then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
go test -tags ci -covermode=atomic -coverprofile=coverage.out ./...
$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
if [ $coverage -lt 69 ]; then echo "Test coverage lowered"; exit 1; fi
if [[ "$TRAVIS_PULL_REQUEST" == "false" && -n "$COVERALLS_TOKEN" ]]
then
$(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN
fi
fi
env:
Expand Down

0 comments on commit ea85544

Please sign in to comment.