-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 793 Bytes
/
Makefile
File metadata and controls
33 lines (25 loc) · 793 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
APP_NAME := kx
.PHONY: build run clean test lint build-cov integration
build:
go build -o ./bin/$(APP_NAME) ./main.go
build-cov:
go build -o ./bin/$(APP_NAME)-cov -cover ./main.go
run: build
./bin/$(APP_NAME) --shell $$SHELL
clean:
go clean
rm -f ./bin/$(APP_NAME)
unit:
go test ./internal/... -cover
test: build-cov
@rm -rf .coverdata
@mkdir -p .coverdata/integration
@mkdir -p .coverdata/unit
@mkdir -p .coverdata/merged
go test ./... -cover -args -test.gocoverdir=${PWD}/.coverdata/unit
@go tool covdata merge -i=.coverdata/unit,.coverdata/integration -o=.coverdata/merged
@go tool covdata percent -i=.coverdata/merged
@go tool covdata textfmt -i=.coverdata/merged -o .coverdata/coverage.txt
go tool cover -func=.coverdata/coverage.txt
lint:
golangci-lint run ./...