From 07711df7526c120499b8db330b6cfaada8e749bc Mon Sep 17 00:00:00 2001 From: Nicolas Lamirault Date: Tue, 10 Feb 2015 13:56:14 +0100 Subject: [PATCH] update coveralls --- .gitignore | 3 ++- .travis.yml | 7 ++++++- Makefile | 14 +++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1f263aa..0d1143d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Godeps/_workspace onlinelabs -coverage.out \ No newline at end of file +coverage.out +gover.coverprofile \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index df7b358..2aa9c59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: go go: - 1.3 +before_install: + - go get github.com/axw/gocov/gocov + - go get github.com/mattn/goveralls + - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi install: - go get -t -v ./... script: @@ -8,4 +12,5 @@ script: # - go test -v ./... - make init - make deps - - make test + - make coverage + - $HOME/gopath/bin/goveralls -service=travis-ci diff --git a/Makefile b/Makefile index 43f372c..5cecdbe 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ DOCKER = docker GODEP= $(DIR)/Godeps/_workspace/bin/godep GOLINT= $(DIR)/Godeps/_workspace/bin/golint ERRCHECK= $(DIR)/Godeps/_workspace/bin/errcheck +GOVER= $(DIR)/Godeps/_workspace/bin/gover GOVERALLS= $(DIR)/Godeps/_workspace/bin/goveralls NO_COLOR=\033[0m @@ -46,7 +47,7 @@ help: clean: @echo -e "$(OK_COLOR)[$(APP)] Cleanup$(NO_COLOR)" - @rm -f $(EXE) $(EXE)_* $(APP)-*.tar.gz + @rm -f $(EXE) $(EXE)_* $(APP)-*.tar.gz coverage.out gover.coverprofile .PHONY: destroy destroy: @@ -108,12 +109,11 @@ covoutput: # @GOPATH=$(GO_PATH) go tool cover -html=coverage.out @GOPATH=$(GO_PATH) go tool cover -func=coverage.out -coveralls: build - @GOPATH=$(GO_PATH) go get -v github.com/axw/gocov/gocov - @GOPATH=$(GO_PATH) go get golang.org/x/tools/cmd/cover - @GOPATH=$(GO_PATH) go get -v github.com/mattn/goveralls - @GOPATH=$(GO_PATH) go test -covermode=count -coverprofile=profile.cov - @GOPATH=$(GO_PATH) $(GOVERALLS) -coverprofile=profile.cov -service=travis-ci $(COVERALLS_TOKEN) +coveralls: + @GOPATH=$(GO_PATH) go get -u code.google.com/p/go.tools/cmd/cover || go get -u golang.org/x/tools/cmd/cover + @GOPATH=$(GO_PATH) go get -u github.com/axw/gocov/gocov + @GOPATH=$(GO_PATH) go get github.com/mattn/goveralls + @PATH=$(PATH):$(DIR)/Godeps/_workspace/bin/ GOPATH=$(GO_PATH) $(GOVERALLS) -service drone.io -repotoken $$COVERALLS_TOKEN github.com/nlamirault/$(APP) release: clean build @echo -e "$(OK_COLOR)[$(APP)] Make archive $(VERSION) $(NO_COLOR)"