-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (57 loc) · 1.88 KB
/
Makefile
File metadata and controls
67 lines (57 loc) · 1.88 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
.PHONY: test bench bench-5x lint lint-all tag tag-all tag-delete help
TAG ?=
LINT_DIRS := . ginx fiberx echox hertzx conformance
TAG_ADAPTERS := ginx fiberx echox hertzx
test:
go test ./conformance/... -v
bench:
go test -run '^$$' -bench BenchmarkFramework -benchmem ./conformance/...
bench-5x:
go test -run '^$$' -bench BenchmarkFramework -benchmem -count=5 ./conformance/...
lint: lint-all
lint-all:
@set -e; \
for dir in $(LINT_DIRS); do \
cd $$dir; \
go fix ./...; \
go fmt ./...; \
go vet ./...; \
go get ./...; \
go test ./...; \
go mod tidy; \
golangci-lint fmt --no-config --enable gofmt,goimports; \
golangci-lint run --no-config --fix; \
nilaway ./...; \
cd - >/dev/null; \
done
tag:
@test -n "$(TAG)" || (echo "TAG is required: make tag TAG=v0.0.1" && exit 1)
git tag -s $(TAG) -m "$(TAG)"
git push origin --tags
tag-all:
@test -n "$(TAG)" || (echo "TAG is required: make tag-all TAG=v0.0.1" && exit 1)
@set -e; \
for adapter in $(TAG_ADAPTERS); do \
git tag -s $$adapter/$(TAG) -m "$$adapter/$(TAG)"; \
done
git push origin --tags
tag-delete:
@test -n "$(TAG)" || (echo "TAG is required: make tag-delete TAG=v0.0.1" && exit 1)
-git tag -d $(TAG)
@for adapter in $(TAG_ADAPTERS); do \
git tag -d $$adapter/$(TAG) || true; \
done
-git push origin --delete $(TAG)
@for adapter in $(TAG_ADAPTERS); do \
git push origin --delete $$adapter/$(TAG) || true; \
done
help:
@printf '%s\n' \
'Targets:' \
' test run conformance tests' \
' bench run framework benchmarks' \
' bench-5x run framework benchmarks 5 times' \
' lint | lint-all run checks for all modules' \
' tag TAG=v0.0.1 create and push root tag' \
' tag-all TAG=v0.0.1 create and push adapter tags' \
' tag-delete TAG=v0.0.1 delete local and remote tags'