-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (39 loc) · 1.24 KB
/
Makefile
File metadata and controls
48 lines (39 loc) · 1.24 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
main_package_path = ./cmd/sqliteadmin
binary_name = sqliteadmin
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## audit: run quality control checks
.PHONY: audit
audit: test
go mod tidy -diff
go mod verify
test -z "$(shell gofmt -l .)"
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./...
go run golang.org/x/vuln/cmd/govulncheck@latest ./...
## test: run all tests
.PHONY: test
test:
go test -v -race ./...
## test/cover: run all tests and display coverage
.PHONY: test/cover
test/cover:
go test -v -race -buildvcs -coverprofile=/tmp/coverage.out ./...
go tool cover -html=/tmp/coverage.out
# ==================================================================================== #
# DEVELOPMENT
# ==================================================================================== #
## tidy: tidy modfiles and format .go files
.PHONY: tidy
tidy:
go mod tidy -v
go fmt ./...
## build: build the application
.PHONY: build
build:
go build -o=/tmp/bin/${binary_name} ${main_package_path}
## run: run the application
.PHONY: run
run: build
/tmp/bin/${binary_name}