forked from textileio/bidbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 loc) · 1.86 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
include .bingo/Variables.mk
.DEFAULT_GOAL=build
HEAD_SHORT ?= $(shell git rev-parse --short HEAD)
BIN_BUILD_FLAGS?=CGO_ENABLED=0
BIN_VERSION?="git"
GOVVV_FLAGS=$(shell $(GOVVV) -flags -version $(BIN_VERSION) -pkg $(shell go list ./buildinfo))
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run
.PHONYY: lint
build: $(GOVVV)
$(BIN_BUILD_FLAGS) go build -ldflags="${GOVVV_FLAGS}" .
.PHONY: build
install: $(GOVVV)
$(BIN_BUILD_FLAGS) go install -ldflags="${GOVVV_FLAGS}" .
.PHONY: install
mocks: $(MOCKERY) clean-mocks
$(MOCKERY) --name="(FilClient|LotusClient)" --keeptree --recursive
.PHONY: mocks
clean-mocks:
rm -rf mocks
.PHONY: clean-mocks
protos: $(BUF) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) clean-protos
$(BUF) generate --template '{"version":"v1beta1","plugins":[{"name":"go","out":"gen","opt":"paths=source_relative","path":$(PROTOC_GEN_GO)},{"name":"go-grpc","out":"gen","opt":"paths=source_relative","path":$(PROTOC_GEN_GO_GRPC)}]}'
.PHONY: protos
clean-protos:
find . -type f -name '*.pb.go' -delete
find . -type f -name '*pb_test.go' -delete
.PHONY: clean-protos
# local is what we run when testing locally.
# This does breaking change detection against our local git repository.
.PHONY: buf-local
buf-local: $(BUF)
$(BUF) lint
# $(BUF) check breaking --against-input '.git#branch=main'
# https is what we run when testing in most CI providers.
# This does breaking change detection against our remote HTTPS git repository.
.PHONY: buf-https
buf-https: $(BUF)
$(BUF) lint
# $(BUF) check breaking --against-input "$(HTTPS_GIT)#branch=main"
# ssh is what we run when testing in CI providers that provide ssh public key authentication.
# This does breaking change detection against our remote HTTPS ssh repository.
# This is especially useful for private repositories.
.PHONY: buf-ssh
buf-ssh: $(BUF)
$(BUF) lint
# $(BUF) check breaking --against-input "$(SSH_GIT)#branch=main"