Skip to content

Commit

Permalink
ci: add codecov (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmc authored and achew22 committed Jan 3, 2018
1 parent c1c70b3 commit 61c34cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ before_script:
- sh -c 'cd examples/browser && npm install'
script:
- make realclean && make examples SWAGGER_CODEGEN="java -jar $HOME/local/swagger-codegen-cli.jar"
- if (go version | grep -q 1.8) && [ -z "${GATEWAY_PLUGIN_FLAGS}" ]; then test -z "$(git status --porcelain)" || (git status; git diff; exit 1); fi
- if (go version | grep -q 1.9) && [ -z "${GATEWAY_PLUGIN_FLAGS}" ]; then test -z "$(git status --porcelain)" || (git status; git diff; exit 1); fi
- env GLOG_logtostderr=1 go test -race -v github.com/grpc-ecosystem/grpc-gateway/...
- if (go version | grep -q 1.9) && [ -z "${GATEWAY_PLUGIN_FLAGS}" ]; then env GLOG_logtostderr=1 ./bin/coverage; fi
- make lint
- sh -c 'cd examples/browser && node ./node_modules/gulp/bin/gulp'
after_success:
- bash <(curl -s https://codecov.io/bash)
env:
global:
- "PATH=$PATH:$HOME/local/bin"
Expand Down
11 changes: 11 additions & 0 deletions bin/coverage
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
> 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

0 comments on commit 61c34cc

Please sign in to comment.