forked from flashbots/mev-boost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (60 loc) · 1.93 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
VERSION ?= $(shell git describe --tags --always --dirty="-dev")
DOCKER_REPO := flashbots/mev-boost
.PHONY: all
all: build
.PHONY: v
v:
@echo "${VERSION}"
.PHONY: build
build:
go build -trimpath -ldflags "-s -X 'github.com/flashbots/mev-boost/config.Version=${VERSION}'" -v -o mev-boost .
.PHONY: build-portable
build-portable:
CGO_CFLAGS="-O -D__BLST_PORTABLE__" go build -trimpath -ldflags "-s -X 'github.com/flashbots/mev-boost/config.Version=${VERSION}'" -v -o mev-boost .
.PHONY: build-testcli
build-testcli:
go build -trimpath -ldflags "-s -X 'github.com/flashbots/mev-boost/config.Version=${VERSION}'" -v -o test-cli ./cmd/test-cli
.PHONY: test
test:
go test ./...
.PHONY: test-race
test-race:
go test -race ./...
.PHONY: lint
lint:
gofmt -d -s .
gofumpt -d -extra .
staticcheck ./...
golangci-lint run
.PHONY: test-coverage
test-coverage:
go test -race -v -covermode=atomic -coverprofile=coverage.out ./...
go tool cover -func coverage.out
.PHONY: cover
cover:
go test -coverprofile=coverage.out ./...
go tool cover -func coverage.out
unlink coverage.out
.PHONY: cover-html
cover-html:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
unlink coverage.out
.PHONY: run-mergemock-integration
run-mergemock-integration: build
./scripts/run_mergemock_integration.sh
.PHONY: docker-image
docker-image:
DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --build-arg CGO_CFLAGS="" --build-arg VERSION=${VERSION} . -t mev-boost
docker tag mev-boost:latest ${DOCKER_REPO}:${VERSION}
docker tag mev-boost:latest ${DOCKER_REPO}:latest
.PHONY: docker-image-portable
docker-image-portable:
DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --build-arg CGO_CFLAGS="-O -D__BLST_PORTABLE__" --build-arg VERSION=${VERSION} . -t mev-boost
docker tag mev-boost:latest ${DOCKER_REPO}:${VERSION}
.PHONY: docker-push-version
docker-push-version:
docker push ${DOCKER_REPO}:${VERSION}
.PHONY: clean
clean:
git clean -fdx