@@ -4,7 +4,7 @@ on: [ pull_request ]
44
55jobs :
66 compliant :
7- runs-on : [ self-hosted, X64 ]
7+ runs-on : [ self-hosted, X64, Linux ]
88 steps :
99 - uses : actions/checkout@v3
1010
@@ -16,29 +16,18 @@ jobs:
1616 - name : Check Spell
1717 uses : crate-ci/typos@v1.13.14
1818
19- staticcheck :
20- runs-on : [ self-hosted, X64 ]
19+ # 用一个新的、更强大的 linter 作业替换 staticcheck
20+ linter :
21+ runs-on : [ self-hosted, X64, Linux ]
2122 steps :
2223 - uses : actions/checkout@v3
2324 - name : Set up Go
2425 uses : actions/setup-go@v3
2526 with :
26- go-version : 1.19
27-
28- - uses : actions/cache@v3
29- with :
30- path : ~/go/pkg/mod
31- key : reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
32- restore-keys : |
33- reviewdog-${{ runner.os }}-go-
34- - uses : reviewdog/action-staticcheck@v1
27+ go-version : 1.20
28+ - name : Run golangci-lint
29+ # 使用官方的 golangci-lint-action
30+ uses : golangci/golangci-lint-action@v6
3531 with :
36- github_token : ${{ secrets.github_token }}
37- # Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
38- reporter : github-pr-review
39- # Report all results.
40- filter_mode : added
41- # Exit with 1 when it find at least one finding.
42- fail_on_error : true
43- # Set staticcheck flags
44- staticcheck_flags : -checks=inherit,-SA1029,-SA2002,-SA4006,-SA2002,-SA9003,-S1024 -exclude=example
32+ # 指定要使用的 golangci-lint 版本
33+ version : v2.5.0
0 commit comments