-
Notifications
You must be signed in to change notification settings - Fork 116
/
.gitlab-ci.yml
53 lines (48 loc) · 1.07 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
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.62
variables:
GOLANGCI_LINT_CACHE: $CI_PROJECT_DIR/.cache/golangci-lint
cache:
key:
files:
- go.mod
- go.sum
paths:
- $GOLANGCI_LINT_CACHE
script:
- golangci-lint run -v --timeout 5m
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/"