Skip to content

Commit 68cabb9

Browse files
committed
add codecov.io service.
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 9ef83a9 commit 68cabb9

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

.drone.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ pipeline:
7676
when:
7777
event: [ push, tag, pull_request ]
7878

79-
# coverage:
80-
# image: plugins/coverage:latest
81-
# pull: true
82-
# secrets: [ github_token ]
83-
# server: https://coverage.gitea.io
79+
coverage:
80+
image: robertstettner/drone-codecov
81+
secrets: [ codecov_token ]
82+
files:
83+
- coverage.all
84+
when:
85+
event: [ push, pull_request ]
8486

8587
static:
8688
image: karalabe/xgo-latest:latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ _testmain.go
3030
*.prof
3131

3232
*coverage.out
33+
coverage.all
3334

3435
/modules/options/bindata.go
3536
/modules/public/bindata.go

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,13 @@ coverage: unit-test-coverage integration-test-coverage
139139
@hash gocovmerge > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
140140
$(GO) get -u github.com/wadey/gocovmerge; \
141141
fi
142+
echo "mode: set" > coverage.all
142143
for PKG in $(PACKAGES); do\
143-
touch $$GOPATH/src/$$PKG/coverage.out;\
144-
egrep "$$PKG[^/]*\.go" integration.coverage.out > int.coverage.out;\
145-
gocovmerge $$GOPATH/src/$$PKG/coverage.out int.coverage.out > pkg.coverage.out;\
146-
mv pkg.coverage.out $$GOPATH/src/$$PKG/coverage.out;\
147-
rm int.coverage.out;\
144+
egrep "$$PKG[^/]*\.go" integration.coverage.out > int.coverage.out;\
145+
gocovmerge $$GOPATH/src/$$PKG/coverage.out int.coverage.out > pkg.coverage.out;\
146+
grep -h -v "^mode:" pkg.coverage.out >> coverage.all;\
147+
mv pkg.coverage.out $$GOPATH/src/$$PKG/coverage.out;\
148+
rm int.coverage.out;\
148149
done;
149150

150151
.PHONY: unit-test-coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
77
[![Join the Matrix chat at https://matrix.to/#/#gitea:matrix.org](https://img.shields.io/badge/matrix-%23gitea%3Amatrix.org-7bc9a4.svg)](https://matrix.to/#/#gitea:matrix.org)
88
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
9-
[![Coverage Status](https://coverage.gitea.io/badges/go-gitea/gitea/coverage.svg)](https://coverage.gitea.io/go-gitea/gitea)
9+
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
1010
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
1111
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
1212
[![Release](https://github-release-version.herokuapp.com/github/go-gitea/gitea/release.svg?style=flat)](https://github.com/go-gitea/gitea/releases/latest)

0 commit comments

Comments
 (0)