-
Notifications
You must be signed in to change notification settings - Fork 80
/
.gitlab-ci.yml
58 lines (51 loc) · 1.1 KB
/
.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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
- go -C ./tools mod download
test:lint:
stage: test
image: golangci/golangci-lint:v1.62
script:
- golangci-lint run -v
test:tidy:
stage: test
image: golang:1.23
script:
- go mod tidy -v
- git diff --exit-code
test:generate:
stage: test
image: golang:1.23
script:
- go generate ./...
- git diff --exit-code
test:unit:
stage: test
image: golang:1.23
script:
- go test -v -coverpkg=./... -coverprofile=coverage.txt -covermode count ./...
- go -C ./tools 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/"