forked from beyondstorage/go-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 1.12 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
55
56
SHELL := /bin/bash
.PHONY: all check format vet lint build test generate tidy integration_test
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 " integration_test to run integration test"
check: vet
format:
@echo "gofmt"
@gofmt -w -l .
@echo "ok"
vet:
@echo "go vet"
@go vet ./...
@echo "ok"
generate:
@echo "generate code"
@go generate -tags tools ./...
@gofmt -w -l .
@echo "ok"
build: tidy generate format check
@echo "build storage"
@go build -tags tools ./...
@echo "ok"
test:
@echo "run test"
@go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
@go tool cover -html="coverage.txt" -o "coverage.html"
@echo "ok"
integration_test:
@echo "run integration test"
@pushd tests \
&& go test -race -v ./... \
&& popd
@echo "ok"
tidy:
@go mod tidy
@go mod verify
clean:
@echo "clean generated files"
@find . -type f -name 'generated.go' -delete
@echo "Done"