-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 763 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (28 loc) · 763 Bytes
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
.PHONY: build check test test-race bench lint fmt vet tidy artisan clean
GOFLAGS := -trimpath
PKG := ./...
ARTISAN := ./cmd/artisan
build:
go build $(GOFLAGS) ./...
# Run all checks a CI run performs. Invoked by CONTRIBUTING.md.
check: vet test
@gofmt -l . | (! grep .) || (echo "gofmt: files need formatting; run 'make fmt'" && exit 1)
test:
go test $(GOFLAGS) -count=1 $(PKG)
test-race:
go test $(GOFLAGS) -race -count=1 $(PKG)
cover:
go test $(GOFLAGS) -cover -coverprofile=coverage.out $(PKG)
go tool cover -func=coverage.out
bench:
go test $(GOFLAGS) -bench=. -benchmem -run=^$$ ./benchmarks/...
fmt:
gofmt -s -w .
vet:
go vet $(PKG)
tidy:
go mod tidy
artisan:
go build -o bin/artisan $(ARTISAN)
clean:
rm -rf bin coverage.out