-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 919 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
.PHONY: all clean test coverage benchmark benchdata-gen benchdata-serve
all: coverage
# go list is the canonical utility to find go files
GOFILES := $(shell go list -f '{{ join .GoFiles "\n" }}' ./...)
GOACC := $(shell command -v go-acc 2> /dev/null)
GOBENCHDATA := $(shell command -v gobenchdata 2> /dev/null)
test:
go test -covermode=atomic -coverpkg=all ./...
benchmark:
go test -bench=. ./...
benchdata-gen:
ifndef GOBENCHDATA
go install go.bobheadxi.dev/gobenchdata@latest
endif
go test -bench . -benchmem ./... | gobenchdata --append --json benchmarks.json
benchdata-serve: benchdata-gen
gobenchdata web serve
coverage: .artifacts-stamp
ifndef GOACC
go install github.com/ory/go-acc@latest
endif
go-acc -o artifacts/c.out ./...
go tool cover -html=artifacts/c.out -o artifacts/coverage.html
.artifacts-stamp:
mkdir artifacts
touch .artifacts-stamp
clean:
rm -rf artifacts
rm .artifacts-stamp