-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (43 loc) · 812 Bytes
/
Makefile
File metadata and controls
49 lines (43 loc) · 812 Bytes
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
export CGO_ENABLED = 0
#
# Default Target
#
.PHONY:
all: fmt build test
#
# Build Target
#
.PHONY:
build: .build.prepare
go build -ldflags="-s -w" -o ./build/openevt ./cmd/openevt
#
# Format Target
#
.PHONY:
fmt: .build.prepare
gofmt -s -w .
go tool goimports -w -l .
#
# Test Target
#
.PHONY:
test: .build.prepare
go tool gotestsum --junitfile build/tests.xml --format testdox --format-hide-empty-pkg -- -count=1 -coverprofile=build/coverage.out -covermode count ./...
go tool cover -func build/coverage.out | tail -n 1 | tr -s '[:blank:]'
go tool cover -html=build/coverage.out -o build/coverage.html
#
# Clean Target
#
# Remove build artifacts.
.PHONY:
clean:
rm -rf build
#
# [internal] Build Prepare Target
#
.PHONY:
.build.prepare:
go mod download
go mod verify
go mod tidy
mkdir -p build