-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
40 lines (31 loc) · 882 Bytes
/
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
TEST_OPT=""
GOLANGCI_LINT_VERSION := 1.50.1
.PHONY: bootstrap
bootstrap:
mkdir -p bin
GOBIN=$(PWD)/bin go install github.com/golang/mock/mockgen@latest
.PHONY: bootstrap_golangci_lint
bootstrap_golangci_lint:
mkdir -p ./bin
GOBIN=${PWD}/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$(GOLANGCI_LINT_VERSION)
.PHONY: test
test: goimports
go test ./... -v ${TEST_OPT}
.PHONY: goimports
goimports:
cd /tmp && go install golang.org/x/tools/cmd/goimports@latest
.PHONY: code_clean
code_clean:
cd generator/testfiles && rm -rf */*_gen.go
.PHONY: lint
lint: lint_golangci_lint
.PHONY: lint_golangci_lint
lint_golangci_lint:
./bin/golangci-lint run --config=".github/.golangci.yml" --fast ./...
.PHONY: build
build:
go build -o ./bin/volcago ./cmd/volcago
.PHONY: gen_samples
gen_samples: build bootstrap
go generate ./examples
go test ./generator