From 0182e2c0bc968261c90c619ee14c1e1eeeece25d Mon Sep 17 00:00:00 2001 From: Jakub Date: Mon, 30 Jan 2023 13:40:38 +0100 Subject: [PATCH] GODT-2287: Add code coverage to artifacts and pipeline. --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6841984f..8a7cc133 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -54,6 +54,18 @@ stages: allow_failure: true - when: never +.after-script-code-coverage: + after_script: + - go get github.com/boumenot/gocover-cobertura + - go run github.com/boumenot/gocover-cobertura < /tmp/coverage.out > coverage.xml + - "go tool cover -func=/tmp/coverage.out | grep total:" + coverage: '/total:.*\(statements\).*\d+\.\d+%/' + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage.xml + # Stage: TEST lint: @@ -69,6 +81,7 @@ test-linux: stage: test extends: - .rules-branch-manual-MR-always + - .after-script-code-coverage script: - make test tags: @@ -106,6 +119,8 @@ dependency-updates: script: - make updates + + # Stage: BUILD .build-base: