-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 1.01 KB
/
Makefile
File metadata and controls
33 lines (23 loc) · 1.01 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
TEST_FLAGS ?= -p 8 -failfast -race -shuffle on
GOTOOLCHAIN := $(shell cat go.mod | grep "^go" | tr -d ' ')
all:
@echo "make <cmd>:"
@echo ""
@echo "commands:"
@awk -F'[ :]' '/^#+/ {comment=$$0; gsub(/^#+[ ]*/, "", comment)} !/^(_|all:)/ && /^([A-Za-z_-]+):/ && !seen[$$1]++ {printf " %-24s %s\n", $$1, (comment ? "- " comment : ""); comment=""} !/^#+/ {comment=""}' Makefile
test-clean:
go clean -testcache
test: test-clean
go test -run=$(TEST) $(TEST_FLAGS) -json ./... | tparse --all --follow
test-rerun: test-clean
go run github.com/goware/rerun/cmd/rerun -watch ./ -run 'make test'
test-coverage:
go test -run=$(TEST) $(TEST_FLAGS) -cover -coverprofile=coverage.out -json ./... | tparse --all --follow
test-coverage-inspect: test-coverage
go tool cover -html=coverage.out
generate:
WEBRPC_SCHEMA_VERSION=$(shell git log -1 --date=format:'v0-%y.%-m.%-d' --format='%ad+%h' ./proto/*.ridl) \
GOTOOLCHAIN=$(GOTOOLCHAIN) go generate -x ./...
proto: generate
lint:
golangci-lint run ./... --fix -c .golangci.yml