forked from hetznercloud/csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
44 lines (39 loc) · 903 Bytes
/
.gitlab-ci.yml
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
39
40
41
42
43
44
include:
- project: cloud/integrations/ci
file:
- default.yml
- workflows/feature-branches.yml
variables:
GOMODCACHE: $CI_PROJECT_DIR/.cache/go-mod
GOCACHE: $CI_PROJECT_DIR/.cache/go-build
cache:
key:
files:
- go.mod
- go.sum
paths:
- $GOMODCACHE
build:
stage: build
image: golang:1.23
script:
- go env
- go mod download
test:lint:
stage: test
image: golangci/golangci-lint:v1.61
script:
- golangci-lint run -v
test:unit:
stage: test
image: golang:1.23
script:
- 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
coverage: "/coverage: \\d+.\\d+% of statements/"