forked from celestiaorg/go-square
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (33 loc) · 1.01 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
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.28.1
PROJECTNAME=$(shell basename "$(PWD)")
## help: Get more info on make commands.
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
.PHONY: help
## proto-gen: Generate protobuf files. Requires docker.
proto-gen:
@echo "--> Generating Protobuf files"
$(DOCKER_BUF) generate
.PHONY: proto-gen-docker
## proto-lint: Lint protobuf files. Requires docker.
proto-lint:
@echo "--> Linting Protobuf files"
@$(DOCKER_BUF) lint
.PHONY: proto-lint
## lint: Lint Go files. Requires golangci-lint.
lint:
@echo "--> Lint source code using golangci-lint"
@golangci-lint run
.PHONY: lint
## test: Run unit tests.
test:
@echo "--> Run unit tests"
@go test -mod=readonly ./...
.PHONY: test
## benchmark: Run tests in benchmark mode.
benchmark:
@echo "--> Perform benchmark"
@go test -mod=readonly -bench=. ./...
.PHONY: benchmark