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:
parent
ffa8eb12b3
commit
672ac28d8f
30
.drone.yml
30
.drone.yml
|
@ -10,21 +10,21 @@ clone:
|
||||||
|
|
||||||
pipeline:
|
pipeline:
|
||||||
deps:
|
deps:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make deps
|
- make deps
|
||||||
- make embedmd
|
- make embedmd
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make vet
|
- make vet
|
||||||
- make lint
|
- make lint
|
||||||
|
|
||||||
vendor:
|
vendor:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make test-vendor
|
- make test-vendor
|
||||||
|
@ -32,50 +32,58 @@ pipeline:
|
||||||
- make fmt-check
|
- make fmt-check
|
||||||
|
|
||||||
build_linux_amd64:
|
build_linux_amd64:
|
||||||
image: appleboy/golang-testing
|
image: golang:1.10.1
|
||||||
pull: true
|
pull: true
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make build_linux_amd64
|
- make build_linux_amd64
|
||||||
|
|
||||||
build_linux_i386:
|
build_linux_i386:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
pull: true
|
pull: true
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make build_linux_i386
|
- make build_linux_i386
|
||||||
|
|
||||||
build_linux_arm64:
|
build_linux_arm64:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
pull: true
|
pull: true
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make build_linux_arm64
|
- make build_linux_arm64
|
||||||
|
|
||||||
build_linux_arm:
|
build_linux_arm:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
pull: true
|
pull: true
|
||||||
group: golang
|
group: golang
|
||||||
commands:
|
commands:
|
||||||
- make build_linux_arm
|
- make build_linux_arm
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
group: golang
|
group: golang
|
||||||
secrets: [ android_test_token, android_api_key ]
|
secrets: [ android_test_token, android_api_key ]
|
||||||
commands:
|
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:
|
codecov:
|
||||||
image: robertstettner/drone-codecov
|
image: robertstettner/drone-codecov
|
||||||
secrets: [ codecov_token ]
|
secrets: [ codecov_token ]
|
||||||
files:
|
files:
|
||||||
- .cover/coverage.txt
|
- coverage.all
|
||||||
when:
|
when:
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
|
|
||||||
release:
|
release:
|
||||||
image: appleboy/golang-testing:1.10.0
|
image: golang:1.10.1
|
||||||
pull: true
|
pull: true
|
||||||
commands:
|
commands:
|
||||||
- make release
|
- make release
|
||||||
|
|
|
@ -34,3 +34,4 @@ coverage.txt
|
||||||
dist
|
dist
|
||||||
custom
|
custom
|
||||||
release
|
release
|
||||||
|
coverage.out
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -112,8 +112,19 @@ misspell-check: $(MISSPELL)
|
||||||
misspell: $(MISSPELL)
|
misspell: $(MISSPELL)
|
||||||
$(MISSPELL) -w $(GOFILES)
|
$(MISSPELL) -w $(GOFILES)
|
||||||
|
|
||||||
test: fmt-check
|
.PHONY: coverage
|
||||||
for PKG in $(PACKAGES); do $(GO) test -v -cover -coverprofile $$GOPATH/src/$$PKG/coverage.txt $$PKG || exit 1; done;
|
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
|
.PHONY: test-vendor
|
||||||
test-vendor: $(GOVENDOR)
|
test-vendor: $(GOVENDOR)
|
||||||
|
|
Loading…
Reference in New Issue