forked from kardianos/service
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (47 loc) · 1.47 KB
/
linter.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
name: Linter
on: [pull_request]
jobs:
go-staticcheck:
name: go-staticcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Run go-staticcheck
run: |
go get honnef.co/go/tools/cmd/staticcheck@latest # ideally we should version pin
PKGS=$(go list ./... | grep -v /vendor/ | grep -v pkg/ui | grep -v cmd/mte_service_ui )
go run honnef.co/go/tools/cmd/staticcheck $PKGS
go-vet:
name: go-vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Run go-vet
run: |
PKGS=$(go list ./... | grep -v /vendor/ | grep -v pkg/ui | grep -v cmd/mte_service_ui )
go vet -json $PKGS | tee vet-report.json
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: go-vet-results
path: vet-report.json
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
- name: Run golangci-lint
run: |
go run github.com/golangci/golangci-lint/cmd/golangci-lint run -v --timeout 10m0s