forked from nikoksr/notify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (40 loc) · 1.38 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
export GO111MODULE := on
export GOPROXY = https://proxy.golang.org,direct
###############################################################################
# DEPENDENCIES
###############################################################################
# Install all the build and lint dependencies
setup:
go mod tidy
@go install mvdan.cc/gofumpt@latest
@go install github.com/daixiang0/gci@latest
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install github.com/vektra/mockery/v2@latest
.PHONY: setup
###############################################################################
# TESTS
###############################################################################
# Run all the tests
test:
go test -failfast -race -timeout=5m ./...
.PHONY: test
cover:
go test -race -covermode=atomic -coverprofile=coverage.out ./...
.PHONY: cover
mock:
go generate ./...
.PHONY: mock
###############################################################################
# CODE HEALTH
###############################################################################
fmt:
@gofumpt -w -l .
@gci write --section Standard --section Default --section "Prefix(github.com/nikoksr/notify)" .
.PHONY: fmt
lint:
@golangci-lint run --config .golangci.yml
.PHONY: lint
ci: lint test
.PHONY: ci
###############################################################################
.DEFAULT_GOAL := ci