|
34 | 34 | .PHONY: install-all-deps |
35 | 35 | install-all-deps: install-site-deps ## Install all dependencies for building both binary and user docs) |
36 | 36 |
|
| 37 | +.PHONY: install-tools |
| 38 | +install-tools: ## Install dependencies for code generation and test execution |
| 39 | + go install github.com/golangci/golangci-lint/cmd/golangci-lint |
| 40 | + go install github.com/cloudflare/cfssl/cmd/...@latest |
| 41 | + go install github.com/maxbrunsfeld/counterfeiter/v6 |
| 42 | + go install github.com/vektra/mockery/v2 |
| 43 | + go install github.com/vburenin/ifacemaker |
| 44 | + |
37 | 45 | ##@ Build |
38 | 46 |
|
39 | 47 | godeps_cmd = go list -deps -f '{{if not .Standard}}{{ $$dep := . }}{{range .GoFiles}}{{$$dep.Dir}}/{{.}} {{end}}{{end}}' $(1) | sed "s|$(git_toplevel)/||g" |
@@ -72,28 +80,24 @@ $(info will launch integration tests for Kubernetes version $(INTEGRATION_TEST_V |
72 | 80 | endif |
73 | 81 |
|
74 | 82 | .PHONY: lint |
75 | | -lint: ## Run linter over the codebase |
76 | | - go install github.com/golangci/golangci-lint/cmd/golangci-lint |
| 83 | +lint: install-tools ## Run linter over the codebase |
77 | 84 | golangci-lint run --timeout=30m |
78 | 85 |
|
79 | 86 | .PHONY: test |
80 | | -test: ## Lint, generate and run unit tests. Also ensure that integration tests compile |
81 | | - go install github.com/cloudflare/cfssl/cmd/...@latest |
| 87 | +test: install-tools ## Lint, generate and run unit tests. Also ensure that integration tests compile |
82 | 88 | $(MAKE) lint |
83 | 89 | $(MAKE) unit-test |
84 | 90 | $(MAKE) build-integration-test |
85 | 91 |
|
86 | 92 | .PHONY: unit-test |
87 | 93 | unit-test: check-all-generated-files-up-to-date unit-test-no-generate |
88 | 94 |
|
89 | | -.PHONY: unit-test-no-generate ## Run unit test only |
90 | | -unit-test-no-generate: |
91 | | - go install github.com/cloudflare/cfssl/cmd/...@latest |
| 95 | +.PHONY: unit-test-no-generate |
| 96 | +unit-test-no-generate: install-tools ## Run unit test only |
92 | 97 | CGO_ENABLED=0 go test -tags=release ./pkg/... ./cmd/... $(UNIT_TEST_ARGS) |
93 | 98 |
|
94 | 99 | .PHONY: unit-test-race |
95 | | -unit-test-race: ## Run unit test with race detection |
96 | | - go install github.com/cloudflare/cfssl/cmd/...@latest |
| 100 | +unit-test-race: install-tools ## Run unit test with race detection |
97 | 101 | CGO_ENABLED=1 go test -race ./pkg/... ./cmd/... $(UNIT_TEST_ARGS) |
98 | 102 |
|
99 | 103 | .PHONY: build-integration-test |
@@ -138,10 +142,7 @@ delete-integration-test-dev-cluster: build ## Delete the test cluster for use wh |
138 | 142 | ##@ Code Generation |
139 | 143 |
|
140 | 144 | .PHONY: generate-always |
141 | | -generate-always: ## Generate code (required for every build) |
142 | | - go install github.com/maxbrunsfeld/counterfeiter/v6 |
143 | | - go install github.com/vektra/mockery/v2 |
144 | | - go install github.com/vburenin/ifacemaker |
| 145 | +generate-always: install-tools ## Generate code (required for every build) |
145 | 146 | go generate ./pkg/apis/eksctl.io/v1alpha5/generate.go |
146 | 147 | go generate ./pkg/nodebootstrap |
147 | 148 | go generate ./pkg/addons |
|
0 commit comments