-
Notifications
You must be signed in to change notification settings - Fork 9.2k
103 lines (100 loc) · 3.54 KB
/
golangci-lint.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
name: golangci-lint Checks
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths:
- .github/workflows/golangci-lint.yml
- .ci/.golangci*.yml
- .ci/tools/**
- internal/**
- go.sum
- main.go
- names/**
- tools/**
## NOTE: !!!
## When changing these workflows, ensure that the following is updated:
## - Documentation: docs/continuous-integration.md
## - Documentation: docs/makefile-cheat-sheet.md
## - Makefile: ./GNUmakefile
jobs:
golangci-linta:
name: 1 of 3
runs-on: custom-linux-large
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
cache: false
- id: golangci-lint-version
working-directory: .ci/tools
run: >-
echo "version=$(
go list -m all |
grep github.com/golangci/golangci-lint |
awk '{print $2}'
)" >> $GITHUB_OUTPUT
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: "${{ steps.golangci-lint-version.outputs.version }}"
args: --config .ci/.golangci.yml
golangci-lintb:
name: 2 of 3
needs: [golangci-linta]
runs-on: custom-linux-xl
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
cache: false
- id: golangci-lint-version
working-directory: .ci/tools
run: >-
echo "version=$(
go list -m all |
grep github.com/golangci/golangci-lint |
awk '{print $2}'
)" >> $GITHUB_OUTPUT
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: "${{ steps.golangci-lint-version.outputs.version }}"
args: --config .ci/.golangci2.yml
env:
# Trigger garbage collection more frequently to reduce the likelihood
# of OOM errors. Higher values mean it runs faster but more likely to OOM, exit 137.
# ref: https://golangci-lint.run/product/performance/
GOGC: "150" # 100 is the default value
golangci-lintc:
name: 3 of 3
needs: [golangci-linta]
runs-on: custom-linux-xl
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
cache: false
- id: golangci-lint-version
working-directory: .ci/tools
run: >-
echo "version=$(
go list -m all |
grep github.com/golangci/golangci-lint |
awk '{print $2}'
)" >> $GITHUB_OUTPUT
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: "${{ steps.golangci-lint-version.outputs.version }}"
args: --config .ci/.golangci3.yml
env:
# Trigger garbage collection more frequently to reduce the likelihood
# of OOM errors. Higher values mean it runs faster but more likely to OOM, exit 137.
# ref: https://golangci-lint.run/product/performance/
GOGC: "150" # 100 is the default value