ci: generate code coverage while running tests
This commit is contained in:
parent
e8cc1e03fe
commit
9800573814
1 changed files with 9 additions and 1 deletions
|
|
@ -9,7 +9,15 @@ test:
|
|||
stage: test
|
||||
image: golang:alpine
|
||||
script:
|
||||
- go test ./... -v
|
||||
- go mod download
|
||||
- go test ./... -v -coverprofile=coverage.txt -covermode count
|
||||
- go get github.com/boumenot/gocover-cobertura
|
||||
- go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml
|
||||
artifacts:
|
||||
reports:
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: coverage.xml
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
|
|
|||
Reference in a new issue