chore(coverage): update coverage command. (#354)

* chore(coverage): update coverage command.

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2018-04-22 09:17:16 +08:00 committed by GitHub
parent ffa8eb12b3
commit 672ac28d8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 13 deletions

View File

@ -10,21 +10,21 @@ clone:
pipeline:
deps:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
group: golang
commands:
- make deps
- make embedmd
lint:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
group: golang
commands:
- make vet
- make lint
vendor:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
group: golang
commands:
- make test-vendor
@ -32,50 +32,58 @@ pipeline:
- make fmt-check
build_linux_amd64:
image: appleboy/golang-testing
image: golang:1.10.1
pull: true
group: golang
commands:
- make build_linux_amd64
build_linux_i386:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
pull: true
group: golang
commands:
- make build_linux_i386
build_linux_arm64:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
pull: true
group: golang
commands:
- make build_linux_arm64
build_linux_arm:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
pull: true
group: golang
commands:
- make build_linux_arm
coverage:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
group: golang
secrets: [ android_test_token, android_api_key ]
commands:
- coverage all
- make unit-test-coverage
generate-coverage:
image: golang:1.10.1
pull: true
commands:
- make coverage
when:
event: [ push, pull_request ]
codecov:
image: robertstettner/drone-codecov
secrets: [ codecov_token ]
files:
- .cover/coverage.txt
- coverage.all
when:
event: [ push, pull_request ]
release:
image: appleboy/golang-testing:1.10.0
image: golang:1.10.1
pull: true
commands:
- make release

1
.gitignore vendored
View File

@ -34,3 +34,4 @@ coverage.txt
dist
custom
release
coverage.out

View File

@ -112,8 +112,19 @@ misspell-check: $(MISSPELL)
misspell: $(MISSPELL)
$(MISSPELL) -w $(GOFILES)
test: fmt-check
for PKG in $(PACKAGES); do $(GO) test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;
.PHONY: coverage
coverage:
@hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/wadey/gocovmerge; \
fi
gocovmerge $(shell find . -type f -name "coverage.out") > coverage.all;\
.PHONY: unit-test-coverage
unit-test-coverage: init
for PKG in $(PACKAGES); do $(GO) test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
test: init
for PKG in $(PACKAGES); do $(GO) test -v $$PKG || exit 1; done;
.PHONY: test-vendor
test-vendor: $(GOVENDOR)