diff --git a/Makefile b/Makefile index c32a5f1..ec810b8 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,14 @@ # Run go golanci-lint lint: golangci-lint - $(LOCALBIN)/golangci-lint run --fix + $(GOLANGCI_LINT) run --fix # Run go mod tidy tidy: go mod tidy # Run tests -test: tidy lint - go test ./... -coverprofile=coverage.out - go tool cover -func=coverage.out +test: ginkgo tidy lint + $(GINKGO) -r --cover --coverprofile=coverage.out release: semver @version=$$($(LOCALBIN)/semver); \ @@ -30,11 +29,13 @@ $(LOCALBIN): ## Tool Binaries SEMVER ?= $(LOCALBIN)/semver GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint +GINKGO ?= $(LOCALBIN)/ginkgo DEEPCOPY_GEN ?= $(LOCALBIN)/deepcopy-gen ## Tool Versions SEMVER_VERSION ?= v1.1.3 GOLANGCI_LINT_VERSION ?= v1.52.2 +GINKGO_VERSION ?= v2.9.2 DEEPCOPY_GEN_VERSION ?= v0.26.3 ## Tool Installer @@ -46,6 +47,10 @@ $(SEMVER): $(LOCALBIN) golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. $(GOLANGCI_LINT): $(LOCALBIN) test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) +.PHONY: ginkgo +ginkgo: $(GINKGO) ## Download ginkgo locally if necessary. +$(GINKGO): $(LOCALBIN) + test -s $(LOCALBIN)/ginkgo || GOBIN=$(LOCALBIN) go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION) .PHONY: deepcopy-gen deepcopy-gen: $(DEEPCOPY_GEN) ## Download deepcopy-gen locally if necessary. $(DEEPCOPY_GEN): $(LOCALBIN) @@ -57,9 +62,11 @@ update-toolbox-tools: @rm -f \ $(LOCALBIN)/semver \ $(LOCALBIN)/golangci-lint \ + $(LOCALBIN)/ginkgo \ $(LOCALBIN)/deepcopy-gen toolbox makefile -f $(LOCALDIR)/Makefile \ github.com/bakito/semver \ github.com/golangci/golangci-lint/cmd/golangci-lint \ + github.com/onsi/ginkgo/v2/ginkgo \ k8s.io/code-generator/cmd/deepcopy-gen@github.com/kubernetes/code-generator ## toolbox - end