diff --git a/Makefile b/Makefile index 124805b0b7..3499b752b4 100755 --- a/Makefile +++ b/Makefile @@ -47,6 +47,11 @@ KERNEL_VERSION ?= 4.16.14 GO_VERSION ?= $(shell go version | cut -d' ' -f3 | sed -e 's/go//') GOLINT_VERSION ?= v1.17.1 +# Limit number of default jobs, to avoid the CI builds running out of memory +GOLINT_JOBS ?= 1 +# see https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint +GOLINT_GOGC ?= 10 + export GO111MODULE := on GOOS ?= $(shell go env GOOS) @@ -275,7 +280,8 @@ out/linters/golangci-lint: .PHONY: lint lint: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go out/linters/golangci-lint - ./out/linters/golangci-lint run \ + GOGC=${GOLINT_GOGC} ./out/linters/golangci-lint run \ + --concurrency ${GOLINT_JOBS} \ --deadline 4m \ --build-tags "${MINIKUBE_INTEGRATION_BUILD_TAGS}" \ --enable goimports,gocritic,golint,gocyclo,interfacer,misspell,nakedret,stylecheck,unconvert,unparam \