Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.44 KB
/
Copy pathMakefile
File metadata and controls
43 lines (34 loc) · 1.44 KB
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
# Setting SHELL to bash allows bash commands to be executed by recipes.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
PROJECT_ROOT=.
include ${PROJECT_ROOT}/hack/tools.mk
##@ General
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\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)
##@ Development
.PHONY: test
test: ## Run unit tests.
go test `go list ./... | grep -v /tests/e2e` -race -coverprofile=cover.out
@echo "Total test coverage: $$(go tool cover -func=cover.out | grep total | awk '{print $$3}')"
@rm cover.out
.PHONY: lint
lint: golangci-lint ## Run golangci-lint.
$(GOLANGCI_LINT) run -v
.PHONY: verify
verify: ## Run all verification checks.
@./hack/verify.sh
.PHONY: build
build: ## Build the kyma CLI binary.
GOFIPS140=v1.0.0 go build -ldflags="-X github.com/kyma-project/cli.v3/internal/cmd/version.version=local-$(shell git rev-parse --short HEAD)" -o bin/kyma main.go
.PHONY: build-for-codeql
build-for-codeql: ## Build all binaries for CodeQL analysis.
go build -o /dev/null ./...
.PHONY: docs
docs: ## Generate CLI documentation.
go mod tidy
rm -r ${PROJECT_ROOT}/docs/user/gen-docs
mkdir ${PROJECT_ROOT}/docs/user/gen-docs
go run gen-docs/main.go --skip-extensions