forked from fsnotify/fsnotify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (41 loc) · 966 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
define USAGE
USAGE:
> make [
test: run all unit tests
test-unit: run all unit tests
lint: run golangci-linter
clean: clean test cache and other deps
help: print this help message
]
endef
export USAGE
SHELL := /bin/bash
BIN := $(PWD)/bin
GO := go
GOTEST := $(BIN)/gotest
LINT := $(BIN)/golangci-lint
export PATH := $(PATH):$(BIN)
help:
@echo "$$USAGE"
usage:
@echo "$$USAGE"
sense:
@echo "$$USAGE"
install-dep-tools:
GOBIN=$(BIN) $(GO) get -u github.com/rakyll/gotest
@make install-golangci-lint
install-golangci-lint:
# binary will be $(BIN)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BIN) v1.40.0
test: test-unit
test-unit: install-dep-tools testclean
$(GOTEST) ./... -v -race
testclean:
$(GO) clean -testcache || true
clean: testclean
rm -rf $(BIN)/*
$(GO) clean -cache
$(GO) clean -modcache
lint: install-dep-tools
$(LINT) run --config golangci.yml ./...
ci: test lint