From 223e93ae110400108ca726ac21b705b0f42968ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Mon, 29 Jan 2024 14:25:42 +0000 Subject: [PATCH] Collect test coverage during CI --- .gitlab-ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5de8f61..577de61 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -62,7 +62,17 @@ lint: go-test: image: golang:$GO_VERSION-$ALPINE_VERSION stage: test - script: go test -v ./... + before_script: + - go get github.com/boumenot/gocover-cobertura + script: + - go test -v ./... -coverprofile=coverage.txt + - go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml + coverage: '/coverage: \d+.\d+% of statements/' + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage.xml .docker-build: image: docker:24.0.5 -- GitLab