-
Notifications
You must be signed in to change notification settings - Fork 45
/
.gitlab-ci.yml
48 lines (42 loc) · 938 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
45
46
47
48
include:
- project: cloud/integrations/ci
file:
- default.yml
- workflows/feature-branches.yml
stages:
- build
- test
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
script:
- golangci-lint run -v
test:unit:
stage: test
image: golang:1.23
script:
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- 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/"