File tree 2 files changed +37
-2
lines changed
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : golangci-lint
2
+ on :
3
+ push :
4
+ paths :
5
+ - " go.sum"
6
+ - " go.mod"
7
+ - " **.go"
8
+ - " scripts/errcheck_excludes.txt"
9
+ - " .github/workflows/golangci-lint.yml"
10
+ pull_request :
11
+ paths :
12
+ - " go.sum"
13
+ - " go.mod"
14
+ - " **.go"
15
+ - " scripts/errcheck_excludes.txt"
16
+ - " .github/workflows/golangci-lint.yml"
17
+
18
+ jobs :
19
+ golangci :
20
+ name : lint
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - name : Checkout repository
24
+ uses : actions/checkout@v2
25
+
26
+ - name : Lint
27
+ uses : golangci/golangci-lint-action@v2
28
+ with :
29
+ version : v1.42.0
Original file line number Diff line number Diff line change @@ -83,12 +83,18 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
83
83
84
84
GOLANGCI_LINT :=
85
85
GOLANGCI_LINT_OPTS ?=
86
- GOLANGCI_LINT_VERSION ?= v1.39 .0
86
+ GOLANGCI_LINT_VERSION ?= v1.42 .0
87
87
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
88
88
# windows isn't included here because of the path separator being different.
89
89
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
90
90
ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386))
91
- GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
91
+ # If we're in CI and there is an Actions file, that means the linter
92
+ # is being run in Actions, so we don't need to run it here.
93
+ ifeq (,$(CIRCLE_JOB))
94
+ GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
95
+ else ifeq (,$(wildcard .github/workflows/golangci-lint.yml))
96
+ GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint
97
+ endif
92
98
endif
93
99
endif
94
100
You can’t perform that action at this time.
0 commit comments