-
Notifications
You must be signed in to change notification settings - Fork 41
65 lines (57 loc) · 1.66 KB
/
code-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
name: Golang Code Lint
# Lint runs golangci-lint over the entire Tendermint repository
# This workflow is run on every pull request and push to master
# The `golangci` job will pass without running if no *.{go, mod, sum} files have been modified.
on:
push:
branches:
- master
- develop
- fix-release*
pull_request:
branches:
jobs:
golangci:
name: golangci-lint
runs-on: ${{ matrix.os }}
timeout-minutes: 8
strategy:
matrix:
go-version: [1.20.x]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: bufbuild/buf-setup-action@v1.14.0
with:
version: 1.14.0
buf_user: "${{ secrets.BUF_REGISTRY_USER }}"
buf_api_token: "${{ secrets.BUF_REGISTRY_SECRET }}"
- name: Install Protoc
uses: arduino/setup-protoc@v1
- run: |
make install-tools
make buf-gen
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- run: |
go mod tidy
go mod download
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and
# must be specified without patch version: we always use the
# latest patch version.
version: latest
skip-pkg-cache: true
skip-cache: true
skip-build-cache: true
args: --timeout 30m -v
github-token: ${{ secrets.github_token }}
if: env.GIT_DIFF