-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (71 loc) · 1.69 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
77
78
79
80
81
82
83
84
85
86
87
VERSION := $(shell git describe --tags --always --dirty="-dev")
.PHONY: all
all: clean build
.PHONY: v
v:
@echo "Version: ${VERSION}"
.PHONY: clean
clean:
rm -rf build/
.PHONY: build
build:
@mkdir -p ./build
go build -trimpath -ldflags "-X github.com/flashbots/system-api/common.Version=${VERSION}" -v -o ./build/system-api cmd/system-api/*.go
.PHONY: run
run:
SHELL_TO_USE=/bin/bash go run cmd/system-api/main.go --config systemapi-config.toml
# .PHONY: build-httpserver
# build-httpserver:
# @mkdir -p ./build
# go build -trimpath -ldflags "-X github.com/flashbots/system-api/common.Version=${VERSION}" -v -o ./build/httpserver cmd/httpserver/main.go
.PHONY: test
test:
go test ./...
.PHONY: test-race
test-race:
go test -race ./...
.PHONY: lint
lint:
gofmt -d -s .
gofumpt -d -extra .
go vet ./...
staticcheck ./...
golangci-lint run
# nilaway ./...
.PHONY: fmt
fmt:
gofmt -s -w .
gci write .
gofumpt -w -extra .
go mod tidy
.PHONY: gofumpt
gofumpt:
gofumpt -l -w -extra .
.PHONY: lt
lt: lint test
.PHONY: cover
cover:
go test -coverprofile=/tmp/go-sim-lb.cover.tmp ./...
go tool cover -func /tmp/go-sim-lb.cover.tmp
unlink /tmp/go-sim-lb.cover.tmp
.PHONY: cover-html
cover-html:
go test -coverprofile=/tmp/go-sim-lb.cover.tmp ./...
go tool cover -html=/tmp/go-sim-lb.cover.tmp
unlink /tmp/go-sim-lb.cover.tmp
.PHONY: docker-cli
docker-cli:
DOCKER_BUILDKIT=1 docker build \
--platform linux/amd64 \
--build-arg VERSION=${VERSION} \
--file cli.dockerfile \
--tag your-project \
.
.PHONY: docker-httpserver
docker-httpserver:
DOCKER_BUILDKIT=1 docker build \
--platform linux/amd64 \
--build-arg VERSION=${VERSION} \
--file httpserver.dockerfile \
--tag your-project \
.