-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 1.72 KB
/
Copy pathMakefile
File metadata and controls
68 lines (54 loc) · 1.72 KB
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
63
64
65
66
67
68
.PHONY: all
all: checks unit-tests unit-tests-race
.PHONY: checks
checks: check-deps
@test -z $(shell gofmt -l -s $(shell go list -f '{{.Dir}}' ./... | grep -v mpc) | tee /dev/stderr) || (echo "Fix formatting issues"; exit 1)
@go vet -all $(shell go list -f '{{.Dir}}' ./... | grep -v mpc)
find . -name '*.go' | xargs addlicense -check || (echo "Missing license headers"; exit 1)
.PHONY: unit-tests
unit-tests:
@go test ./...
.PHONY: unit-tests-race
unit-tests-race:
@export GORACE=history_size=7; go test -timeout 960s -race -cover $(shell go list ./...)
.PHONY: check-deps
check-deps:
@go install github.com/google/addlicense@latest
.PHONY: idemixgen
idemixgen:
@go install ./tools/idemixgen
.PHONY: binaries
binaries:
mkdir -p bin/amd64
GOOS=linux GOARCH=amd64 go build -o bin/amd64/idemixgen tools/idemixgen/main.go
mkdir -p bin/arm64
GOOS=darwin GOARCH=arm64 go build -o bin/arm64/idemixgen tools/idemixgen/main.go
.PHONY: installbuf
installbuf:
go install github.com/bufbuild/buf/cmd/buf@v1.70.0
.PHONY: genprotos
genprotos:
buf generate --template buf.gen.yaml
.PHONY: fmt
fmt: ## Run gofmt on the entire project
@echo "Running gofmt..."
@gofmt -l -s -w .
.PHONY: tidy
# tidy up go modules
tidy:
@go mod tidy
.PHONY: lint
# run various linters
lint:
@echo "Running Go Linters..."
golangci-lint run --color=always --timeout=4m
.PHONY: lint-auto-fix
# run linters with auto-fix
lint-auto-fix:
@echo "Running Go Linters with auto-fix..."
golangci-lint run --color=always --timeout=4m --fix
.PHONY: install-linter-tool
# install golangci-lint
install-linter-tool:
@echo "Installing golangci Linter"
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(HOME)/go/bin v2.12.2