-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (33 loc) · 1.11 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
.PHONY: all
all: corex
.PHONY: corex
corex:
GIT_COMMIT=`git rev-list -1 HEAD 2>/dev/null || echo ""` && \
GIT_DATE=`git log -1 --date=short --pretty=format:%ct 2>/dev/null || echo ""` && \
go build \
-ldflags "-s -w -X github.com/corex-mn/go-corex/cmd/opera/launcher.gitCommit=$${GIT_COMMIT} -X github.com/corex-mn/go-corex/cmd/opera/launcher.gitDate=$${GIT_DATE}" \
-o build/corex \
./cmd/opera
TAG ?= "latest"
.PHONY: corex-image
corex-image:
docker build \
--network=host \
--build-arg GOPROXY=$(GOPROXY) \
-f ./docker/Dockerfile.corex -t "corex:$(TAG)" .
.PHONY: test
test:
go test ./...
.PHONY: coverage
coverage:
go test -coverprofile=cover.prof $$(go list ./... | grep -v '/gossip/contract/' | grep -v '/gossip/emitter/mock' | xargs)
go tool cover -func cover.prof | grep -e "^total:"
.PHONY: fuzz
fuzz:
CGO_ENABLED=1 \
mkdir -p ./fuzzing && \
go run github.com/dvyukov/go-fuzz/go-fuzz-build -o=./fuzzing/gossip-fuzz.zip ./gossip && \
go run github.com/dvyukov/go-fuzz/go-fuzz -workdir=./fuzzing -bin=./fuzzing/gossip-fuzz.zip
.PHONY: clean
clean:
rm -fr ./build/*