-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (60 loc) · 2.88 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
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
69
70
71
72
73
74
75
.PHONY: install
GO_PACKAGES ?= $(shell go list ./... | grep -v 'mock')
doc: doc-binaries
@PYTHONPATH="$$(pwd)/bin/python:$$PYTHONPATH" ./bin/python/bin/markdown-pp README_pp.md -o README.md
doc-amend: doc
@git add ./README.md || true
@git add ./README_pp.md|| true
@git commit --amend --no-edit
test-binaries:
@test -f "./bin/go/gotest" || GOBIN="$$(pwd)/bin/go" go install github.com/rakyll/[email protected]
doc-binaries:
@test -f "./bin/python/bin/markdown-pp" || pip install --target="$$(pwd)/bin/python" MarkdownPP
lint-binary:
@test -f "./bin/go/golangci-lint" || GOBIN="$$(pwd)/bin/go" go install github.com/golangci/golangci-lint/cmd/[email protected]
lint: lint-binary
@./bin/go/golangci-lint run
test-ci:
@go test -v ./...
@go test -v ./towerhttp/...
@TOWER_HTTP_TEST_EXPORTED=true go test -v ./towerhttp -run "^TestGlobalRespond"
@go test -v ./towerzap/...
@go test -v ./loader/...
@go test -v ./queue/...
@go test -v ./towerdiscord/...
@go test -v ./cache/...
@go test -v ./cache/gomemcache/...
@go test -v ./cache/goredis/v8/...
@go test -v ./cache/goredis/v9/...
@go test -v ./bucket/...
@go test -v ./bucket/minio/v7/...
@go test -v ./bucket/s3/v2/...
test: test-binaries
@GOSUMDB=off ./bin/go/gotest -v ./...
@GOSUMDB=off ./bin/go/gotest -v ./towerhttp/...
@TOWER_HTTP_TEST_EXPORTED=true GOSUMDB=off ./bin/go/gotest -v ./towerhttp -run "^TestGlobalRespond"
@GOSUMDB=off ./bin/go/gotest -v ./towerzap/...
@GOSUMDB=off ./bin/go/gotest -v ./loader/...
@GOSUMDB=off ./bin/go/gotest -v ./queue/...
@GOSUMDB=off ./bin/go/gotest -v ./towerdiscord/...
@GOSUMDB=off ./bin/go/gotest -v ./cache/...
@GOSUMDB=off ./bin/go/gotest -v ./cache/gomemcache/...
@GOSUMDB=off ./bin/go/gotest -v ./cache/goredis/v8/...
@GOSUMDB=off ./bin/go/gotest -v ./cache/goredis/v9/...
@GOSUMDB=off ./bin/go/gotest -v ./bucket/...
@GOSUMDB=off ./bin/go/gotest -v ./bucket/minio/v7/...
@GOSUMDB=off ./bin/go/gotest -v ./bucket/s3/v2/...
test-integration: test-binaries
@IN_TEST=true ./bin/go/gotest -v ./...
commitlint: install-commitlint
@NODE_PATH="./bin/node/lib/node_modules:$NODE_PATH" ./bin/node/bin/commitlint --from HEAD~1 --to HEAD
install-commitlint:
@test -f ./bin/node/bin/commitlint || npm install -g --prefix ./bin/node @commitlint/cli @commitlint/config-conventional
@test -f "./commitlint.config.js" || echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
git-hook:
@test -f "./bin/go/lefthook" || GOBIN="$$(pwd)/bin/go" go install github.com/evilmartians/[email protected]
@./bin/go/lefthook install
mc-binary:
@test -f "./bin/mc" || (curl -L "$$ENDPOINT/binaries/mc" --create-dirs -o ./bin/mc && chmod +x ./bin/mc) || (curl -L "https://dl.min.io/client/mc/release/linux-amd64/mc" --create-dirs -o ./bin/mc && chmod +x ./bin/mc)
gotestsum-binary:
@test -f "./bin/go/gotestsum" || GOBIN="$$(pwd)/bin/go" go install -v gotest.tools/gotestsum@latest