Add codecov service

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-06-30 10:09:02 +08:00
parent b6b42c2c73
commit 4e06eee996
3 changed files with 10 additions and 9 deletions

2
.gitignore vendored
View File

@ -28,7 +28,7 @@ key.pem
config.yml
bin/*
.DS_Store
coverage.out
coverage.txt
gorush/log/*.log
build.tar.gz
gorush.tar.gz

View File

@ -31,7 +31,7 @@ install:
script:
- make test
- $(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.out
- $(go env GOPATH | awk 'BEGIN{FS=":"} {print $1}')/bin/goveralls -coverprofile=coverage.txt
-service=travis-ci -repotoken=$COVERALLS_TOKEN
after_success:
@ -41,3 +41,4 @@ after_success:
&& test "$TRAVIS_PULL_REQUEST" == "false" && cd $TRAVIS_BUILD_DIR && make docker_build
- test "$TRAVIS_BRANCH" == "master" && test "$TRAVIS_GO_VERSION" == "1.6.2"
&& test "$TRAVIS_PULL_REQUEST" == "false" && cd $TRAVIS_BUILD_DIR && make deploy tag=latest
- bash <(curl -s https://codecov.io/bash)

View File

@ -26,22 +26,22 @@ build: clean
sh script/build.sh $(VERSION)
test: redis_test boltdb_test memory_test config_test
go test -v -cover -covermode=count -coverprofile=coverage.out ./gorush/...
go test -v -cover -covermode=count -coverprofile=coverage.txt ./gorush/...
redis_test: init
go test -v -cover -covermode=count -coverprofile=coverage.out ./storage/redis/...
go test -v -cover -covermode=count -coverprofile=coverage.txt ./storage/redis/...
boltdb_test: init
go test -v -cover -covermode=count -coverprofile=coverage.out ./storage/boltdb/...
go test -v -cover -covermode=count -coverprofile=coverage.txt ./storage/boltdb/...
memory_test: init
go test -v -cover -covermode=count -coverprofile=coverage.out ./storage/memory/...
go test -v -cover -covermode=count -coverprofile=coverage.txt ./storage/memory/...
config_test: init
go test -v -cover -covermode=count -coverprofile=coverage.out ./config/...
go test -v -cover -covermode=count -coverprofile=coverage.txt ./config/...
html:
go tool cover -html=coverage.out && unlink coverage.out
go tool cover -html=coverage.txt && unlink coverage.txt
docker_build: clean
tar -zcvf build.tar.gz gorush.go gorush config storage Makefile glide.lock glide.yaml
@ -77,4 +77,4 @@ lint:
golint gorush
clean:
-rm -rf build.tar.gz gorush.tar.gz bin/* coverage.out gorush.tar.gz gorush/gorush.db storage/boltdb/gorush.db
-rm -rf build.tar.gz gorush.tar.gz bin/* coverage.txt gorush.tar.gz gorush/gorush.db storage/boltdb/gorush.db