-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
40 lines (29 loc) · 810 Bytes
/
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
.PHONY: all clean build test lint unit_tests integration_tests start_mongo stop_mongo update_deps
.NOTPARALLEL:
TARGET_MODULE := router
GO_BUILD_ENV := CGO_ENABLED=0
SHELL := /bin/dash
all: build
clean:
rm -f $(TARGET_MODULE)
build:
env $(GO_BUILD_ENV) go build
./$(TARGET_MODULE) -version
test: lint unit_tests integration_tests
lint:
@if ! command -v golangci-lint; then \
echo "linting uses golangci-lint: you can install it with:\n"; \
echo " brew install golangci-lint\n"; \
exit 1; \
fi
golangci-lint run
unit_tests:
go test -race $$(go list ./... | grep -v integration_tests)
integration_tests: build start_mongo
go test -race -v ./integration_tests
start_mongo:
./mongo.sh start
stop_mongo:
./mongo.sh stop
update_deps:
go get -t -u ./... && go mod tidy && go mod vendor