-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.41 KB
/
Makefile
File metadata and controls
62 lines (49 loc) · 1.41 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
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
58
59
60
61
62
# vim: ts=4 sw=4 ft=make
MAKEFILE_PATH := $(realpath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(abspath $(dir $(MAKEFILE_PATH)))
# Run tests and linters. If this passes then CI tests
# should also pass.
.PHONY: all
all: test lint
# Common variables
include $(MAKEFILE_DIR)/../../common.mk
# # Run tests an
# Run verbose tests
testverbose: override GO_TEST_FLAGS += -v
# Run verbose tests
testrace: override GO_COVER_FLAGS =
testrace: override GO_TEST_FLAGS += -race
.PHONY: test testverbose testrace
test testverbose testrace:
@GOGC=$(GO_GOGC) $(GO_TEST) ./...
# Actual ci target (separate because so that we can override GO)
.PHONY: .ci
.ci: GO = $(RICHGO_TARGET)
.ci: export RICHGO_FORCE_COLOR=1
.ci: testverbose
# Run and colorize verbose tests for CI
.PHONY: ci
ci: bin/richgo
ci: .ci
# Run golangci-lint
.PHONY: golangci-lint
golangci-lint: bin/golangci-lint
@$(GOLANGCI_TARGET) run
.PHONY: vet
vet:
@$(GO) vet ./...
.PHONY: lint
lint: vet golangci-lint
# Make sure there aren't any comments that need addressing (TODO or WARN)
#
# NOTE: not currently part of the "lint" target.
.PHONY: lint-comments
lint-comments:
@if $(xgrep) $(GREP_COMMENTS) $(COMMENTS); then \
echo ''; \
echo '$(red)FAIL: $(cyan)address comments!$(term-reset)'; \
exit 1; \
fi
.PHONY: clean
clean:
@$(GO) clean -i ./...