1
0
Fork 0

ci: generate code coverage while running tests

This commit is contained in:
Vojtěch Mareš 2024-05-12 22:21:47 +02:00
parent e8cc1e03fe
commit 9800573814
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D

View file

@ -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