forked from greut/eclint
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
89 lines (80 loc) · 1.76 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
image: golang:1.19-bullseye
variables:
NANCY_VERSION: v1.0
GIT_DEPTH: "0"
stages:
- test
- lint
- check
- snapshot
go test:
stage: test
script:
- go test -v ./...
- go test -v ./...
-cover -covermode atomic
-coverprofile coverage.out
-json > test-report.json
- go tool cover -func coverage.out
- go list -u -m -json all > go-list.json
artifacts:
paths:
- coverage.out
- test-report.json
- go-list.json
eclint:
stage: lint
script:
- go build -o eclint gitlab.com/greut/eclint/cmd/eclint
- ./eclint -exclude "testdata/**/*"
golangci-lint:
stage: lint
image: golangci/golangci-lint
script:
- golangci-lint run ./...
- golangci-lint run -v ./...
--issues-exit-code 0
--out-format checkstyle > report.xml
artifacts:
paths:
- report.xml
nancy:
stage: check
image: sonatypecommunity/nancy:${NANCY_VERSION}-alpine
needs:
- go test
script:
- cat go-list.json | nancy --quiet
sonarcloud check:
stage: check
allow_failure: true
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
needs:
- go test
- golangci-lint
script:
- sonar-scanner
-Dsonar.projectVersion=$(git describe --abbrev=0 --tags)
-Dsonar.qualitygate.wait=true # this does nothing yet
go-mod-outdated:
stage: check
allow_failure: true
needs:
- go test
script:
- go install github.com/psampaz/go-mod-outdated@latest
- cat go-list.json | $GOPATH/bin/go-mod-outdated -update -direct -ci
goreleaser snapshot:
stage: check
image:
name: goreleaser/goreleaser
entrypoint: ['']
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
GIT_DEPTH: 0
script:
- goreleaser --snapshot --skip-sign