-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
52 lines (38 loc) · 1.03 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
.PHONY: lint build test jaillover race coverage install acceptance deps docker clean
GOCMD=go
GOBUILD=$(GOCMD) build -trimpath
GOINSTALL=$(GOCMD) install -trimpath
GOGET=$(GOCMD) get
GOTEST=$(GOCMD) test
GOTOOL=$(GOCMD) tool
GOLANGLINT=golangci-lint
PROJECTREPO=github.com/BBVA/kapow
BUILD_DIR=./build
OUTPUT_DIR=./output
TMP_DIR=/tmp
DOCS_DIR=./doc
DOCKER_DIR=./docker
BINARY_NAME=kapow
all: lint test race build
lint:
$(GOLANGLINT) run
build: deps
mkdir -p $(BUILD_DIR)
CGO_ENABLED=0 $(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) -v
test: build jaillover
$(GOTEST) -v -coverprofile=$(TMP_DIR)/c.out ./...
jaillover:
$(GOINSTALL) -v $(PROJECTREPO)/testutils/$@
race: build
$(GOTEST) -race -v ./...
coverage: test race
mkdir -p $(OUTPUT_DIR)
$(GOTOOL) cover -html=$(TMP_DIR)/c.out -o $(OUTPUT_DIR)/coverage.html
install: build
CGO_ENABLED=0 $(GOINSTALL) ./...
acceptance: build
cd ./spec/test && PATH=$(PWD)/build:$$PATH nix-shell --command make
deps:
@echo "deps here"
clean:
rm -rf $(BUILD_DIR) $(OUTPUT_DIR) $(DOCKER_DIR)/*