File tree Expand file tree Collapse file tree 4 files changed +37
-37
lines changed Expand file tree Collapse file tree 4 files changed +37
-37
lines changed Original file line number Diff line number Diff line change 1
- name : golangci-lint
1
+ name : CI
2
2
on :
3
3
pull_request :
4
4
types : [opened, edited, synchronize, reopened]
@@ -14,17 +14,18 @@ permissions:
14
14
checks : write
15
15
16
16
jobs :
17
- golangci :
18
- name : lint
17
+ golangci-lint-matrix :
19
18
runs-on : ubuntu-latest
20
19
strategy :
20
+ fail-fast : false
21
21
matrix :
22
22
working-directory :
23
23
- " "
24
24
- examples/kind
25
25
- providers/kind
26
26
- examples/cluster-api
27
27
- providers/cluster-api
28
+ name : golangci-lint [${{ matrix.working-directory }}]
28
29
steps :
29
30
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
30
31
- name : Calculate go version
37
38
- name : golangci-lint
38
39
uses : golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # tag=v6.5.0
39
40
with :
40
- version : v1.63.4
41
+ version : v1.64.5
41
42
args : --out-format=colored-line-number
42
43
working-directory : ${{matrix.working-directory}}
44
+
45
+ golangci-lint : # aggregate the results of the matrix job. This we can depend on in the branch protection rule.
46
+ name : golangci-lint
47
+ runs-on : ubuntu-latest
48
+ needs :
49
+ - golangci-lint-matrix
50
+ if : (failure() || success()) && !contains(needs.golangci-lint-matrix.result, 'skipped')
51
+ steps :
52
+ - name : noop
53
+ run : exit 1
54
+ if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
55
+
56
+ test :
57
+ name : make test
58
+ runs-on : ubuntu-latest
59
+ steps :
60
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
61
+ - name : Calculate go version
62
+ id : vars
63
+ run : echo "go_version=$(make go-version)" >> $GITHUB_OUTPUT
64
+ - name : Set up Go
65
+ uses : actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # tag=v5.3.0
66
+ with :
67
+ go-version : ${{ steps.vars.outputs.go_version }}
68
+ - name : make test
69
+ run : MAKEFLAGS="-s" make test
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ $(CONTROLLER_GEN): # Build controller-gen from tools folder.
98
98
GOBIN=$(TOOLS_BIN_DIR ) $(GO_INSTALL ) $(CONTROLLER_GEN_PKG ) $(CONTROLLER_GEN_BIN ) $(CONTROLLER_GEN_VER )
99
99
100
100
GOLANGCI_LINT_BIN := golangci-lint
101
- GOLANGCI_LINT_VER := $(shell cat .github/workflows/golangci-lint .yml | grep [[:space:]]version: | sed 's/.* version: //')
101
+ GOLANGCI_LINT_VER := $(shell cat .github/workflows/ci .yml | grep [[:space:]]version: | sed 's/.* version: //')
102
102
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR ) /$(GOLANGCI_LINT_BIN ) -$(GOLANGCI_LINT_VER ) )
103
103
GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
104
104
Original file line number Diff line number Diff line change @@ -31,5 +31,8 @@ if [[ -n ${CI} ]]; then
31
31
make verify-modules
32
32
fi
33
33
34
- header_text " running golangci-lint"
35
- make lint
34
+ # Only run locally because CI has it run in dedicated jobs
35
+ if [[ -z ${CI} ]]; then
36
+ header_text " running golangci-lint"
37
+ make lint
38
+ fi
You can’t perform that action at this time.
0 commit comments