forked from quic-go/quic-go
-
Notifications
You must be signed in to change notification settings - Fork 7
85 lines (84 loc) · 2.85 KB
/
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
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
skip-pkg-cache: true
go-version: "1.20.x"
- name: Check that no non-test files import Ginkgo or Gomega
run: .github/workflows/no_ginkgo.sh
- name: Check for //go:build ignore in .go files
run: |
IGNORED_FILES=$(grep -rl '//go:build ignore' . --include='*.go') || true
if [ -n "$IGNORED_FILES" ]; then
echo "::error::Found ignored Go files: $IGNORED_FILES"
exit 1
fi
- name: Check that go.mod is tidied
if: success() || failure() # run this step even if the previous one failed
run: |
cp go.mod go.mod.orig
cp go.sum go.sum.orig
go mod tidy
diff go.mod go.mod.orig
diff go.sum go.sum.orig
- name: Run code generators
if: success() || failure() # run this step even if the previous one failed
run: .github/workflows/go-generate.sh
- name: Check that go mod vendor works
if: success() || failure() # run this step even if the previous one failed
run: |
cd integrationtests/gomodvendor
go mod vendor
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.20.x"
- name: golangci-lint (Linux)
uses: golangci/golangci-lint-action@v3
with:
skip-pkg-cache: true
args: --timeout=3m
version: v1.52.2
- name: golangci-lint (Windows)
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v3
env:
GOOS: "windows"
with:
skip-pkg-cache: true
args: --timeout=3m
version: v1.52.2
- name: golangci-lint (OSX)
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v3
env:
GOOS: "darwin"
with:
skip-pkg-cache: true
args: --timeout=3m
version: v1.52.2
- name: golangci-lint (FreeBSD)
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v3
env:
GOOS: "freebsd"
with:
skip-pkg-cache: true
args: --timeout=3m
version: v1.52.2
- name: golangci-lint (others)
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v3
env:
GOOS: "solaris" # some OS that we don't have any build tags for
with:
skip-pkg-cache: true
args: --timeout=3m
version: v1.52.2