-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
42 lines (31 loc) · 894 Bytes
/
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
APPNAME := s3-helper
# 'all' is the default target
all: clean build setup-specs run-specs
clean:
rm -f $(APPNAME)
find . -type f -name "*.coverprofile" -delete
rm -rf vendor/
go mod tidy
setup:
go mod vendor
build:
GOSUMDB=off GOPROXY=direct GOOS=linux GOARCH=amd64 go build -o $(APPNAME)
test:
go test ./... -v
run-linters:
gofmt -w -s .
# should be used only once in the local machine
setup-specs:
go install github.com/onsi/ginkgo/v2/ginkgo@latest
go install github.com/onsi/gomega/...
# for running the unit tests in the local machine as well as in the build machine
run-specs:
ginkgo -r --randomize-all --randomize-suites --cover --race --trace
go vet
test-coverage:
go build -o $(APPNAME)
ginkgo -r --randomize-all --randomize-suites --cover -coverprofile=coverage.out --race --trace
go tool cover -html=coverage.out
run:
./$(APPNAME)
.PHONY: clean all compose