-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
38 lines (35 loc) · 937 Bytes
/
.gitlab-ci.yml
File metadata and controls
38 lines (35 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
include:
- project: cloud/integrations/ci
file:
- default.yml
- workflows/feature-branches.yml
- pre-commit.yml
stages:
- test
pre-commit:
extends: [.pre-commit]
test:
stage: test
image: golang:1.26
variables:
GOMODCACHE: $CI_PROJECT_DIR/.cache/go-mod
cache:
key:
files: [go.mod, go.sum]
paths: [$GOMODCACHE]
before_script:
- go get github.com/boumenot/gocover-cobertura@latest
- go mod download
script:
- go test -coverprofile=coverage.txt -v -race ./...
- mv coverage.txt coverage.tmp; grep -v '/zz_' coverage.tmp > coverage.txt; rm coverage.tmp
- go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml
- go tool cover -func=coverage.txt
artifacts:
paths:
- coverage.txt
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
coverage: /total:\s+\(statements\)\s+\d+.\d+%/