Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 1.64 KB
/
Copy pathMakefile
File metadata and controls
54 lines (40 loc) · 1.64 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
48
49
50
51
52
53
54
ifeq (, $(shell which golangci-lint))
$(warning "could not find golangci-lint in $(PATH), see https://golangci-lint.run/usage/install/#local-installation")
endif
ifeq (, $(shell which goreleaser))
$(warning "could not find goreleaser in $(PATH), see https://goreleaser.com/install/")
endif
ifeq (, $(shell which gotestsum))
$(warning "could not find gotestsum in $(PATH), see https://github.com/gotestyourself/gotestsum#install")
endif
ifeq (, $(shell which gofumpt))
$(warning "could not find gofumpt in $(PATH), see https://github.com/mvdan/gofumpt")
endif
.PHONY: all format lint test snapshot install freeze freeze-upgrade generate
default: all
all: install generate lint test snapshot
format:
$(info ******************** checking formatting ********************)
gofumpt -w -extra .
lint:
$(info ******************** running lint tools ********************)
golangci-lint run -v
test:
$(info ******************** running tests ********************)
@gotestsum --format testdox --format-hide-empty-pkg ./...
snapshot:
$(info ******************** building bin: snapshot ********************)
goreleaser build --clean --snapshot --single-target -o "dist/agbridge"
@echo "Bin available at: dist/agbridge"
install:
$(info ******************** downloading dependencies ********************)
go mod download
freeze:
$(info ******************** freeze dependencies ********************)
go mod tidy && go mod verify
freeze-upgrade:
$(info ******************** upgrade dependencies ********************)
go get -u ./... && go mod tidy && go mod verify
generate:
$(info ******************** generating support files ********************)
go generate ./...