forked from mszostok/codeowners-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 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
54
55
56
57
58
59
60
.DEFAULT_GOAL = all
ROOT_DIR:=$(dir $(abspath $(firstword $(MAKEFILE_LIST))))
# enable module support across all go commands.
export GO111MODULE = on
# enable consistent Go 1.12/1.13 GOPROXY behavior.
export GOPROXY = https://proxy.golang.org
all: build-race test-unit test-integration test-lint
.PHONY: all
# When running integration tests on windows machine
# it cannot execute binary without extension.
# It needs to be parametrized, so we can override it on CI.
export BINARY_PATH = $(ROOT_DIR)/codeowners-validator$(BINARY_EXT)
############
# Building #
############
build:
go build -o $(BINARY_PATH) ./main.go
.PHONY: build
build-race:
go build -race -o codeowners-validator ./main.go
.PHONY: build-race
###########
# Testing #
###########
test-unit:
./hack/run-test-unit.sh
.PHONY: test-unit
test-integration: build
./hack/run-test-integration.sh
.PHONY: test-integration
test-lint:
./hack/run-lint.sh
.PHONY: test-lint
test-hammer:
go test -count=100 ./...
.PHONY: test-hammer
test-unit-cover-html: test-unit
go tool cover -html=./coverage.txt
.PHONY: cover-html
###############
# Development #
###############
fix-lint-issues:
LINT_FORCE_FIX=true ./hack/run-lint.sh
.PHONY: fix-lint