-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
54 lines (37 loc) · 1.19 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
SHELL = bash
BUILD_FLAGS =
TEST_FLAGS =
all: fmt tidy build lint test
build:
go build $(BUILD_FLAGS) ./...
builddir:
mkdir -p -m 0777 build
lint:
golangci-lint run
clean:
rm -rf build/*
fmt:
go fmt ./...
test:
go test -race $(BUILD_FLAGS) $(TEST_FLAGS) ./...
# creates a test coverage report, and produces json test output. useful for ci.
cover: builddir
go test $(TEST_FLAGS) -v -covermode=count -coverprofile=build/coverage.out -json ./...
go tool cover -html=build/coverage.out -o build/coverage.html
builder:
docker-compose build --pull builder
docker: builder
docker-compose run --rm builder make all cover
fish: builder
docker-compose run --rm builder fish
tidy:
go mod tidy
update:
go get -u ./...
go mod tidy
### TOOLS
tools:
# installs tools used during build
go get -u golang.org/x/tools/cmd/cover
sh -c "$$(wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh || echo exit 2)" -- -b $(shell go env GOPATH)/bin $(GOLANGCI_LINT_VERSION)
.PHONY: all build builddir run artifacts vet lint clean fmt test testall testreport up down pull builder runc ci bash fish image prep vendor.update vendor.ensure tools buildtools migratetool db.migrate