-
Notifications
You must be signed in to change notification settings - Fork 51
195 lines (156 loc) · 4.67 KB
/
go.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Gosoline
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
terraform-fmt:
name: terraform fmt
runs-on: ubuntu-20.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Execute terraform fmt -check -recursive .
run: terraform fmt -check -recursive .
go-fmt:
name: go fmt
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Execute gofmt -l .
run: gofmt -l .
- name: Execute test -z $(gofmt -l .)
run: test -z $(gofmt -l .)
mockery:
name: mockery
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Install mockery
run: go install github.com/vektra/mockery/[email protected]
- name: Execute mockery
run: go generate -run='mockery' ./...
- name: Check for empty diff
run: |
git add -A *
changes=$(git status -s | grep -E '^[ ]?M|A') || true
if [ "0" != $(echo -n $changes | wc -c) ]; then
git status -s | grep -E '^[ ]?M|A'
echo "please check the file list above and (re-)create those mocks locally with the mockery version v2.22.1!"
echo "here's the diff:"
git diff HEAD~0
echo "end of diff"
exit 1
fi
build:
name: go build
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build
run: go build -v ./...
go-vet:
name: static code analysis (go vet)
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Static code analysis
run: go vet ./...
golangci-lint:
name: static code analysis (golangci-lint)
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Static code analysis (golangci-lint)
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
args: --timeout 5m --print-issued-lines --print-linter-name --disable structcheck --disable unused
go-test:
name: go test
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test
run: go test ./...
go-test-race:
name: go test (race)
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test (race)
run: go test -race ./...
go-test-integration:
name: go test (integration)
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Integration tests
run: go test -p 2 --tags='integration,fixtures' ./test/...
go-test-integration-race:
name: go test (integration, race)
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: go get -v -t -d ./...
- name: Integration tests (race)
run: go test -p 2 -race --tags='integration,fixtures' ./test/...