-
Notifications
You must be signed in to change notification settings - Fork 21
77 lines (70 loc) · 2.65 KB
/
Copy pathlint.yml
File metadata and controls
77 lines (70 loc) · 2.65 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
66
67
68
69
70
71
72
73
74
75
76
77
---
name: Golang Linter
# 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:
pull_request:
push:
branches:
- master
- v[0-9]+.[0-9]+-dev
jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CGO_LDFLAGS: "-L/usr/local/lib -ldashbls -lrelic_s -lmimalloc-secure -lgmp"
CGO_CXXFLAGS: "-I/usr/local/include"
steps:
- uses: actions/checkout@v7
with:
submodules: true
# golangci-lint-action runs with only-new-issues, which diffs the
# branch against its base to decide which findings are new. A shallow
# clone leaves it nothing to diff against, so it falls back to
# reporting every pre-existing issue in the repository.
fetch-depth: 0
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
.github/linters/*
FILES: |
go.mod
go.sum
.golangci.yml
- uses: actions/setup-go@v7.0.0
if: env.GIT_DIFF
with:
go-version: "^1.26.6"
- name: Install dependencies
if: env.GIT_DIFF
run: sudo apt-get update && sudo apt-get install -y libpcap-dev
- uses: ./.github/actions/bls
if: env.GIT_DIFF
name: Install BLS library
- uses: golangci/golangci-lint-action@v9.3.0
if: env.GIT_DIFF
with:
# Required: the version of golangci-lint is required and
# must be specified without patch version: we always use the
# latest patch version.
version: v2.12
# only-new-issues filters against a patch the action assembles itself,
# which it fails to do for a branch with a large diff — it then falls
# back to reporting every pre-existing issue in the repository. Ask
# the linter to do the filtering directly against the base branch,
# which the full-depth checkout above guarantees is present.
args: >-
--timeout 10m
${{ github.event_name == 'pull_request' && format('--new-from-rev=origin/{0}', github.base_ref) || '' }}
github-token: ${{ secrets.github_token }}
# The action refuses --new-* args while only-new-issues is set, so the
# two are mutually exclusive: pull requests filter via --new-from-rev
# above, and pushes keep the action's own filtering.
only-new-issues: ${{ github.event_name != 'pull_request' }}