-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
55 lines (40 loc) · 1.28 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
## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
## Tool Binaries
GOFUMPT ?= $(LOCALBIN)/gofumpt
GOARCH ?= $(shell go env GOARCH)
all: test medius
clean:
rm -rf bin
medius:
CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -o bin/medius kubevirt.io/containerdisks/cmd/medius
fmt: gofumpt
go mod tidy -compat=1.22
$(GOFUMPT) -w -extra .
.PHONY: vendor
vendor:
go mod vendor
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.60.1
.PHONY: lint
lint:
test -s $(GOLANGCI_LINT) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(LOCALBIN) $(GOLANGCI_LINT_VERSION)
CGO_ENABLED=0 $(GOLANGCI_LINT) run --timeout 5m
GINKGO_VERSION ?= v2.20.0
GINKGO_TIMEOUT ?= 2h
.PHONY: getginkgo
getginkgo:
go get github.com/onsi/ginkgo/v2@$(GINKGO_VERSION)
test: lint
CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go run github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION) -v -timeout $(GINKGO_TIMEOUT) ./...
.PHONY: gofumpt
gofumpt: $(GOFUMPT) ## Download gofumpt locally if necessary.
$(GOFUMPT): $(LOCALBIN)
test -s $(LOCALBIN)/gofumpt || GOBIN=$(LOCALBIN) go install mvdan.cc/gofumpt@latest
.PHONY: cluster-up
cluster-up:
hack/kubevirtci.sh up
cluster-down:
hack/kubevirtci.sh down