Skip to content

Commit 3331498

Browse files
committed
chore: Move tool installation to its own make target
1 parent 76e7b9f commit 3331498

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

Makefile

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ endif
3434
.PHONY: install-all-deps
3535
install-all-deps: install-site-deps ## Install all dependencies for building both binary and user docs)
3636

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+
3745
##@ Build
3846

3947
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
7280
endif
7381

7482
.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
7784
golangci-lint run --timeout=30m
7885

7986
.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
8288
$(MAKE) lint
8389
$(MAKE) unit-test
8490
$(MAKE) build-integration-test
8591

8692
.PHONY: unit-test
8793
unit-test: check-all-generated-files-up-to-date unit-test-no-generate
8894

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
9297
CGO_ENABLED=0 go test -tags=release ./pkg/... ./cmd/... $(UNIT_TEST_ARGS)
9398

9499
.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
97101
CGO_ENABLED=1 go test -race ./pkg/... ./cmd/... $(UNIT_TEST_ARGS)
98102

99103
.PHONY: build-integration-test
@@ -138,10 +142,7 @@ delete-integration-test-dev-cluster: build ## Delete the test cluster for use wh
138142
##@ Code Generation
139143

140144
.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)
145146
go generate ./pkg/apis/eksctl.io/v1alpha5/generate.go
146147
go generate ./pkg/nodebootstrap
147148
go generate ./pkg/addons

0 commit comments

Comments
 (0)