This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
forked from kubernetes-sigs/karpenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1.99 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export KUBEBUILDER_ASSETS ?= ${HOME}/.kubebuilder/bin
help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
presubmit: verify test licenses vulncheck ## Run all steps required for code to be checked in
test: ## Run tests
go test ./... \
-race \
--ginkgo.focus="${FOCUS}" \
--ginkgo.v \
-cover -coverprofile=coverage.out -outputdir=. -coverpkg=./...
deflake: ## Run randomized, racing tests until the test fails to catch flakes
ginkgo \
--race \
--focus="${FOCUS}" \
--randomize-all \
--until-it-fails \
-v \
./pkg/...
vulncheck: ## Verify code vulnerabilities
@govulncheck ./pkg/...
licenses: download ## Verifies dependency licenses
! go-licenses csv ./... | grep -v -e 'MIT' -e 'Apache-2.0' -e 'BSD-3-Clause' -e 'BSD-2-Clause' -e 'ISC' -e 'MPL-2.0'
verify: ## Verify code. Includes codegen, dependencies, linting, formatting, etc
go mod tidy
go generate ./...
@# Use perl instead of sed due to https://stackoverflow.com/questions/4247068/sed-command-with-i-option-failing-on-mac-but-works-on-linux
@# We need to do this "sed replace" until controller-tools fixes this parameterized types issue: https://github.com/kubernetes-sigs/controller-tools/issues/756
@perl -i -pe 's/sets.Set/sets.Set[string]/g' pkg/scheduling/zz_generated.deepcopy.go
hack/boilerplate.sh
go vet ./...
golangci-lint run
@git diff --quiet ||\
{ echo "New file modification detected in the Git working tree. Please check in before commit."; git --no-pager diff --name-only | uniq | awk '{print " - " $$0}'; \
if [ "${CI}" = true ]; then\
exit 1;\
fi;}
download: ## Recursively "go mod download" on all directories where go.mod exists
$(foreach dir,$(MOD_DIRS),cd $(dir) && go mod download $(newline))
toolchain: ## Install developer toolchain
./hack/toolchain.sh
.PHONY: help presubmit dev test verify toolchain