-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (21 loc) · 1.28 KB
/
Makefile
File metadata and controls
28 lines (21 loc) · 1.28 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
# <block name="test-env-vars" affects=".github/workflows/tests.yml:test-env-vars">
SERVICES = ETCD_ENDPOINTS="127.0.0.1:2379" REDIS_ADDR="127.0.0.1:6379" REDIS_NODES="127.0.0.1:11000,127.0.0.1:11001,127.0.0.1:11002,127.0.0.1:11003,127.0.0.1:11004,127.0.0.1:11005" ZOOKEEPER_ENDPOINTS="127.0.0.1" CONSUL_ADDR="127.0.0.1:8500" AWS_ADDR="127.0.0.1:8000" MEMCACHED_ADDR="127.0.0.1:11211" POSTGRES_URL="postgres://postgres:postgres@localhost:5432/?sslmode=disable" COSMOS_ADDR="127.0.0.1:8081"
# </block>
all: gofumpt goimports lint test benchmark
docker-compose-up:
docker compose up -d
test: docker-compose-up
@$(SERVICES) go test -race -v -failfast
benchmark: docker-compose-up
@$(SERVICES) go test -race -run=nonexistent -bench=.
lint:
# <block name="golangci-lint-version" affects=".github/workflows/golangci-lint.yml:golangci-lint-version">
@(which golangci-lint && golangci-lint --version | grep 2.10.1) || (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/v2.10.1/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v2.10.1)
# </block>
golangci-lint run --fix ./...
goimports:
@which goimports 2>&1 > /dev/null || go install golang.org/x/tools/cmd/goimports@latest
goimports -w .
gofumpt:
@which gofumpt 2>&1 > /dev/null || go install mvdan.cc/gofumpt@latest
gofumpt -l -w .