forked from beyondstorage/go-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.07 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
SHELL := /bin/bash
.PHONY: all check format vet build test generate tidy integration_test build-all
help:
@echo "Please use \`make <target>\` where <target> is one of"
@echo " check to do static check"
@echo " build to create bin directory and build"
@echo " generate to generate code"
@echo " test to run test"
@echo " build-all to build all packages"
check: vet
format:
gofmt -w -l .
vet:
go vet ./...
generate:
go generate ./...
gofmt -w -l .
build: tidy generate format check
go build ./...
build-all:
for f in $$(find . -name go.mod); \
do make -C $$(dirname $$f) build; \
done
test:
go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
go tool cover -html="coverage.txt" -o "coverage.html"
test-all:
for f in $$(find . -name go.mod); \
do make -C $$(dirname $$f) test; \
done
tidy:
go mod tidy
go mod verify
tidy-all:
for f in $$(find . -name go.mod); \
do make -C $$(dirname $$f) tidy; \
done
clean:
find . -type f -name 'generated.go' -delete