-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (44 loc) · 1.12 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
VERSION=v1.4.4
ifndef GOBIN
ifndef GOPATH
$(error GOPATH is not set, please make sure you set your GOPATH correctly!)
endif
GOBIN=$(GOPATH)/bin
ifndef GOBIN
$(error GOBIN is not set, please make sure you set your GOBIN correctly!)
endif
endif
.PHONY: test-all
test-all: test test-fmt
.PHONY: test
test:
@sh ./scripts/test.sh
.PHONY: test-fmt
test-fmt:
@sh ./scripts/test-fmt.sh
.PHONY: lint
lint: $(GOBIN)/golangci-lint
@echo linting go code...
@$(GOBIN)/golangci-lint run --fix --timeout 10m
# Fix fmt errors in file
.PHONY: fmt
fmt:
go fmt ./...
# Generate mock struct from interface
# example: make mock PKG=./pkg/runtime NAME=Runtime
.PHONY: mock
mock: $(GOBIN)/mockery
@mockery
# Runs cript to upload codecov coverage data
.PHONY: upload-coverage
upload-coverage:
@./scripts/codecov.sh -t $(CODECOV_TOKEN)
.PHONY: cur-version
cur-version:
@echo -n $(VERSION)
$(GOBIN)/mockery:
@go install github.com/vektra/mockery/[email protected]
@mockery --version
$(GOBIN)/golangci-lint:
@echo installing: golangci-lint
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v1.56.2