From 980057381422774315c90521b275b0ea644b60a0 Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Sun, 12 May 2024 22:21:47 +0200 Subject: [PATCH] ci: generate code coverage while running tests --- .gitlab-ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2ffc61..631e6a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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