This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
/
Makefile
177 lines (107 loc) · 3.96 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
.PHONY: deps
deps: deps-ts gqlgen
.PHONY: deps-ts
deps-ts:
yarn install
# gobin allows us to install specific versions of binary tools written in Go.
.PHONY: gobin
gobin:
GO111MODULE=off go get -u github.com/myitcv/gobin
# gqlgen is a tool for embedding files so that they are included in binaries.
# This installs the CLI for go-bindata.
.PHONY: gqlgen
gqlgen: gobin
gobin github.com/99designs/[email protected]
# wasmbrowsertest is required for running WebAssembly tests in the browser.
.PHONY: wasmbrowsertest
wasmbrowsertest: gobin
gobin github.com/0xProject/wasmbrowsertest@mesh-fork
# Installs dependencies without updating Gopkg.lock or yarn.lock
.PHONY: deps-no-lockfile
deps-no-lockfile: deps-ts-no-lockfile wasmbrowsertest gqlgen
.PHONY: deps-ts-no-lockfile
deps-ts-no-lockfile:
yarn install --frozen-lockfile
# Provides a pre-commit convenience command that runs all of the tests and the linters
.PHONY: check
check: test-all lint
.PHONY: test-all
test-all: test-go test-ts
.PHONY: test-go
test-go: generate test-go-parallel test-go-serial
.PHONY: test-go-parallel
test-go-parallel:
go test ./... -race -timeout 30s -p=1
.PHONY: test-key-value-stores
test-key-value-stores: test-key-value-stores-go test-key-value-stores-wasm
.PHONY: test-key-value-stores-go
test-key-value-stores-go:
ENABLE_KEY_VALUE_TESTS=true go test ./db
.PHONY: test-key-value-stores-wasm
test-key-value-stores-wasm:
WASM_INIT_FILE="$$(pwd)/packages/mesh-browser-shim/dist/browser_shim.js" GOOS=js GOARCH=wasm ENABLE_KEY_VALUE_TESTS=true go test ./db -timeout 30m -tags=browser -exec="$$GOPATH/bin/wasmbrowsertest"
.PHONY: test-go-serial
test-go-serial:
go test ./zeroex/ordervalidator ./zeroex/orderwatch ./core -race -timeout 300s -p=1 --serial
.PHONY: test-browser-integration
test-browser-integration: test-browser-legacy-integration test-browser-graphql-integration
.PHONY: test-browser-legacy-integration
test-browser-legacy-integration:
go test ./integration-tests -timeout 60s --enable-browser-legacy-integration-tests -run BrowserLegacyIntegration
.PHONY: test-browser-graphql-integration
test-browser-graphql-integration:
go test ./integration-tests -timeout 60s --enable-browser-graphql-integration-tests -run BrowserGraphQLIntegration
.PHONY: test-browser-conversion
test-browser-conversion:
go test ./packages/mesh-browser/go/conversion-test -timeout 185s --enable-browser-conversion-tests -run BrowserConversions
.PHONY: test-wasm-browser
test-wasm-browser:
WASM_INIT_FILE="$$(pwd)/packages/mesh-browser-shim/dist/browser_shim.js" GOOS=js GOARCH=wasm go test -tags=browser -exec="$$GOPATH/bin/wasmbrowsertest" ./...
.PHONY: test-ts
test-ts:
yarn test
.PHONY: lint
lint: lint-go lint-ts lint-prettier
.PHONY: lint-go
lint-go:
golangci-lint run --timeout 2m
.PHONY: lint-ts
lint-ts:
yarn lint
.PHONY: lint-prettier
lint-prettier:
yarn prettier:ci
.PHONY: generate
generate:
go generate ./...
.PHONY: mesh
mesh: generate
go install ./cmd/mesh
.PHONY: mesh-keygen
mesh-keygen:
go install ./cmd/mesh-keygen
.PHONY: mesh-bootstrap
mesh-bootstrap:
go install ./cmd/mesh-bootstrap
.PHONY: db-integrity-check
db-integrity-check:
go install ./cmd/db-integrity-check
.PHONY: cut-release
cut-release: generate
go run ./cmd/cut-release/main.go
.PHONY: all
all: mesh mesh-keygen mesh-bootstrap db-integrity-check
# Docker images
.PHONY: docker-mesh
docker-mesh: generate
docker build . -t 0xorg/mesh -f ./dockerfiles/mesh/Dockerfile
.PHONY: docker-mesh-bootstrap
docker-mesh-bootstrap:
docker build . -t 0xorg/mesh-bootstrap -f ./dockerfiles/mesh-bootstrap/Dockerfile
.PHONY: docker-mesh-fluent-bit
docker-mesh-fluent-bit:
docker build ./dockerfiles/mesh-fluent-bit -t 0xorg/mesh-fluent-bit -f ./dockerfiles/mesh-fluent-bit/Dockerfile
.PHONY: docker-mesh-bridge
docker-mesh-bridge: generate
@echo 'WARN: mesh-bridge is currently disabled since it has not been updated to use the new GraphQL API'
# docker build . -t 0xorg/mesh-bridge -f ./dockerfiles/mesh-bridge/Dockerfile