Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ azure-cns: $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT) cns-archive
azure-vnet-telemetry: $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT)
acncli: $(ACNCLI_BUILD_DIR)/acncli$(EXE_EXT) acncli-archive

# Tool paths
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
GOCOV := $(TOOLS_BIN_DIR)/gocov
GOCOV_XML := $(TOOLS_BIN_DIR)/gocov-xml
GO_JUNIT_REPORT := $(TOOLS_BIN_DIR)/go-junit-report
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint

# Azure-NPM only supports Linux for now.
ifeq ($(GOOS),linux)
azure-cnms: $(CNMS_BUILD_DIR)/azure-cnms$(EXE_EXT) cnms-archive
Expand Down Expand Up @@ -459,6 +466,11 @@ release:

PRETTYGOTEST := $(shell command -v gotest 2> /dev/null)

LINT_PKG ?= .

lint: $(GOLANGCI_LINT) ## Fast lint
$(GOLANGCI_LINT) run -v $(LINT_PKG)/...

# run all tests
.PHONY: test-all
test-all:
Expand All @@ -481,28 +493,29 @@ kind:
$(TOOLS_DIR)/go.mod:
cd $(TOOLS_DIR); go mod init && go mod tidy

CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
$(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen

controller-gen: $(CONTROLLER_GEN) ## Build controller-gen

GOCOV := $(TOOLS_BIN_DIR)/gocov
$(GOCOV): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/gocov github.com/axw/gocov/gocov

gocov: $(GOCOV) ## Build gocov

GOCOV_XML := $(TOOLS_BIN_DIR)/gocov-xml
$(GOCOV_XML): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/gocov-xml github.com/AlekSi/gocov-xml

gocov-xml: $(GOCOV_XML) ## Build gocov-xml

GO_JUNIT_REPORT := $(TOOLS_BIN_DIR)/go-junit-report
$(GO_JUNIT_REPORT): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/go-junit-report github.com/jstemmer/go-junit-report

go-junit-report: $(GO_JUNIT_REPORT) ## Build go-junit-report

tools: gocov gocov-xml go-junit-report ## Build bins for build tools
$(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go mod download; go build -tags=tools -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint

golangci-lint: $(GOLANGCI_LINT) ## Build golangci-lint

tools: gocov gocov-xml go-junit-report golangci-lint ## Build bins for build tools
3 changes: 2 additions & 1 deletion build/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.16
require (
github.com/AlekSi/gocov-xml v0.0.0-20190121064608-3a14fb1c4737
github.com/axw/gocov v1.0.0
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
github.com/golangci/golangci-lint v1.40.1
github.com/jstemmer/go-junit-report v0.9.1
sigs.k8s.io/controller-tools v0.3.0
)
Loading