-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
62 lines (50 loc) · 1.81 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
57
58
59
60
61
62
build:
go build -o gladia -v ./cmd/*.go
.PHONY: dist
dist:
GOOS=linux GOARCH=arm GOARM=7 go build -o dist/gladia-linux-arm7 -v ./cmd/*.go
GOOS=linux GOARCH=arm64 go build -o dist/gladia-linux-arm64 -v ./cmd/*.go
GOOS=linux GOARCH=amd64 go build -o dist/gladia-linux-x86_64 -v ./cmd/*.go
GOOS=linux GOARCH=386 go build -o dist/gladia-linux-i386 -v ./cmd/*.go
GOOS=windows GOARCH=amd64 go build -o dist/gladia-windows-x86_64.exe -v ./cmd/*.go
GOOS=darwin GOARCH=amd64 go build -o dist/gladia-darwin-x86_64 -v ./cmd/*.go
GOOS=darwin GOARCH=arm64 go build -o dist/gladia-darwin-arm64 -v ./cmd/*.go
@echo "Dist files:"
@ls -l dist
dev:
go run -x ./cmd/*.go -audio-file split_infinity.wav
watch-dev:
go run -x ./cmd/*.go -audio-file split_infinity.wav
test:
go test -race -v ./...
watch-test:
reflex -t 50ms -s -- sh -c 'gotest -race -v ./...'
bench:
go test -benchmem -benchtime=10000000x -bench=. ./...
watch-bench:
reflex -t 50ms -s -- sh -c 'go test -benchmem -benchtime=10000000x -bench=. ./...'
coverage:
go test -v -coverprofile=cover.out -covermode=atomic ./...
go tool cover -html=cover.out -o cover.html
# tools
tools:
go install github.com/cespare/reflex@latest
go install github.com/rakyll/gotest@latest
go install github.com/psampaz/go-mod-outdated@latest
go install github.com/jondot/goweight@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go get -t -u golang.org/x/tools/cmd/cover
go get -t -u github.com/sonatype-nexus-community/nancy@latest
go mod tidy
lint:
golangci-lint run --timeout 60s --max-same-issues 50 ./...
lint-fix:
golangci-lint run --timeout 60s --max-same-issues 50 --fix ./...
audit: tools
go mod tidy
go list -json -m all | nancy sleuth
outdated: tools
go mod tidy
go list -u -m -json all | go-mod-outdated -update -direct
weight: tools
goweight