-
Notifications
You must be signed in to change notification settings - Fork 11
/
.gitlab-ci.yml
54 lines (47 loc) · 1.05 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
stages:
- build
- test
golangci-lint v1.50.1:
stage: test
image: golangci/golangci-lint:v1.50.1
script:
- golangci-lint --version
- golangci-lint run -v
staticcheck v0.3.3:
stage: test
image: golang:1.19
script:
- go install honnef.co/go/tools/cmd/[email protected]
- staticcheck ./...
compile go 1.19:
stage: build
image: golang:1.19
script:
- go build -v ./...
unittests:
stage: test
image: golang:1.19
script:
- go test -race -v ./...
test-report:
stage: test
image: golang:1.19
script:
- go install gotest.tools/gotestsum@latest
- gotestsum --junitfile report.xml --format testname
artifacts:
when: always
reports:
junit: report.xml
coverage:
stage: test
image: golang:1.19
script:
- go test ./... -coverprofile=coverage.txt -covermode count
- go install github.com/boumenot/gocover-cobertura@latest
- gocover-cobertura < coverage.txt > coverage.xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml