-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
33 lines (26 loc) · 675 Bytes
/
makefile
File metadata and controls
33 lines (26 loc) · 675 Bytes
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
MAKEFLAGS := --silent --always-make
TESTFLAGS := $(if $(filter $(verb), true), -v,) -count=1
TEST := test $(TESTFLAGS) -timeout=1s -run=$(run)
BENCH := test $(TESTFLAGS) -run=- -bench=$(or $(run),.) -benchmem -benchtime=128ms
WATCH := watchexec -r -c -d=0 -n
test_w:
gow -c -v $(TEST)
test:
go $(TEST)
bench_w:
gow -c -v $(BENCH)
bench:
go $(BENCH)
lint_w:
$(WATCH) -- $(MAKE) lint
lint:
golangci-lint run
echo [lint] ok
# Example: `make release tag=v0.1.0`.
release:
ifeq ($(tag),)
$(error missing tag)
endif
git pull --rebase
git show-ref --tags --quiet "$(tag)" || git tag "$(tag)"
git push origin $$(git symbolic-ref --short HEAD) "$(tag)"