Repository navigation
65 lines (57 loc) · 1.73 KB
/
Copy pathlint.yaml
File metadata and controls
65 lines (57 loc) · 1.73 KB
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
name: Lint Go
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- 'tools/**'
- '.golangci.yml'
- 'revive.toml'
- '.github/workflows/lint.yaml'
push:
branches:
- master
permissions:
contents: read
jobs:
go-mod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
- name: Check tools/go.mod
working-directory: tools
run: |
go mod tidy -diff
lint-go:
name: Lint Go
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Go and register problem matcher
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: stable
- name: Install revive
run: go install
- name: Run revive
run: revive --config revive.toml ./...
- id: golangci-lint-version
working-directory: tools
run: |
echo "GOLANGCI_LINT_VERSION=$(go list -m -f '{{.Version}}' github.com/golangci/golangci-lint/v2)" >> $GITHUB_OUTPUT
- name: Run golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: ${{ steps.golangci-lint-version.outputs.GOLANGCI_LINT_VERSION }}
args: --verbose