-
Notifications
You must be signed in to change notification settings - Fork 140
/
Copy pathMakefile
58 lines (47 loc) · 1.7 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
52
53
54
55
56
57
58
limiter := limiter
flake-report-writer := robots/cmd/flake-report-writer
flake-issue-creator := robots/cmd/flake-issue-creator
querier := robots/cmd/release-querier
kubevirtci := robots/cmd/kubevirtci-bumper
ifndef GOLANGCI_LINT_VERSION
GOLANGCI_LINT_VERSION=v1.62.2
export GOLANGCI_LINT_VERSION
endif
ifndef ARTIFACTS
ARTIFACTS=/tmp/artifacts
export ARTIFACTS
endif
ifndef COVERAGE_OUTPUT_PATH
COVERAGE_OUTPUT_PATH=${ARTIFACTS}/coverage.html
export COVERAGE_OUTPUT_PATH
endif
.PHONY: all clean deps-update update-labels install-metrics-binaries lint $(limiter) $(flake-report-writer) $(querier) $(kubevirtci) $(flake-issue-creator)
all: deps-update $(limiter) $(flake-report-writer) $(querier) $(kubevirtci) $(flake-issue-creator)
clean: install-metrics-binaries
golangci-lint cache clean
$(limiter) $(flake-report-writer) $(querier) $(kubevirtci) $(flake-issue-creator): deps-update
$(MAKE) --directory=$@
deps-update:
export GO111MODULE=on
go get ./...
go mod tidy
go mod vendor
build:
go build ./external-plugins/... ./releng/... ./robots/... ./github/ci/services/...
test: build
go test ./external-plugins/... ./releng/... ./robots/...
update-labels:
./hack/labels/update.sh
install-metrics-binaries:
if ! command -V golangci-lint; then curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ${GOPATH}/bin ${GOLANGCI_LINT_VERSION} ; fi
lint: install-metrics-binaries
./hack/lint.sh
coverage:
if ! command -V covreport; then go install github.com/cancue/covreport@latest; fi
go test \
./external-plugins/... \
./releng/... \
./robots/... \
-coverprofile=/tmp/coverage.out
mkdir -p ${ARTIFACTS}
covreport -i /tmp/coverage.out -o ${COVERAGE_OUTPUT_PATH}