-
Notifications
You must be signed in to change notification settings - Fork 139
/
Makefile
72 lines (58 loc) · 2.2 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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
bazelbin := bazelisk
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 gazelle-update-repos 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
$(bazelbin) clean
golangci-lint cache clean
$(limiter) $(flake-report-writer) $(querier) $(kubevirtci) $(flake-issue-creator): deps-update
$(MAKE) --directory=$@
bazel-build-all:
$(bazelbin) build //limiter:go_default_library //releng/... //robots/... //github/ci/services/...
deps-update:
export GO111MODULE=on
go get ./...
go mod tidy
go mod vendor
sed -i "s|^.*data = \[\"//prow/plugins:config-src\"\],||g" vendor/k8s.io/test-infra/pkg/genyaml/BUILD.bazel
$(bazelbin) run //:gazelle
gazelle:
$(bazelbin) run //:gazelle
gazelle-update-repos:
$(bazelbin) run //:gazelle -- update-repos -from_file=go.mod
install-bazelisk:
go get -u github.com/bazelbuild/bazelisk
test:
$(bazelbin) build //external-plugins/... //releng/... //robots/... //github/ci/services/...
$(bazelbin) 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}