-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathconfig.yml
More file actions
376 lines (366 loc) · 11.5 KB
/
config.yml
File metadata and controls
376 lines (366 loc) · 11.5 KB
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
version: 2.1
references:
working_directory: &working_directory ~/repo
node_image: &node_image
image: cimg/node:22.14
environment:
NODE_OPTIONS: '--max-old-space-size=4096'
ipfs_image: &ipfs_image
image: requestnetwork/request-ipfs:v0.13.0
ganache_image: &ganache_image
image: trufflesuite/ganache:v7.6.0
command:
- '-l'
- '90000000'
- '-m'
- 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat'
- '-k'
- 'london'
graph_image: &graph_image
image: graphprotocol/graph-node:v0.25.0
# wait for ganache, then start
command: sh -c 'wait_for localhost:8545 -t 30 -- start'
environment:
postgres_host: localhost
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: 'localhost:5001'
ethereum: 'private:http://localhost:8545'
GRAPH_ALLOW_NON_DETERMINISTIC_IPFS: 1
postgres_image: &postgres_image
image: postgres
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
step_graph_deploy: &step_graph_deploy
name: 'Subgraph deployment and configuration'
working_directory: ~/
command: |
git clone https://github.com/RequestNetwork/storage-subgraph
cd storage-subgraph
yarn
yarn codegen ./subgraph-private.yaml
yarn create-local
yarn deploy-local --version-label v0.0.1 ./subgraph-private.yaml
sleep 5
step_wait_for_node: &step_wait_for_node
name: 'Waiting for Request Node to be ready'
command: |
for i in `seq 1 10`;
do
curl -s -o /dev/null -f http://localhost:3000/readyz > /dev/null && echo Success && exit 0
echo -n .
sleep 1
done
echo Failed waiting for Node initialization && exit 1
jobs:
build:
docker:
- *node_image
resource_class: xlarge
working_directory: *working_directory
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- run:
name: Yarn install
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Build all packages with lerna
command: 'yarn build'
- persist_to_workspace:
root: *working_directory
paths:
- ./
- ./.nx-cache
- packages/*/dist
- packages/*/*.tsbuildinfo
lint:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: Verify format
command: yarn format:check
- run:
name: 'lint package.json files'
command: 'yarn run packageJsonLint'
test-unit:
docker:
- *node_image
resource_class: large
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Test unit'
command: |
yarn test \
--ignore @requestnetwork/request-node \
--ignore @requestnetwork/ethereum-storage \
--ignore @requestnetwork/request-client.js \
--ignore @requestnetwork/smart-contracts \
--ignore @requestnetwork/payment-detection \
--ignore @requestnetwork/payment-processor \
--ignore @requestnetwork/integration-test \
--concurrency=2
environment:
# Lerna starts 2 Jest commands at the same time (see above --concurrency=2),
# so we use 50% of our CPU cores on each
JEST_MAX_WORKERS: '50%'
- store_test_results:
path: packages/advance-logic/reports/
- store_test_results:
path: packages/currency/reports/
- store_test_results:
path: packages/data-access/reports/
- store_test_results:
path: packages/data-format/reports/
- store_test_results:
path: packages/epk-cipher/reports/
- store_test_results:
path: packages/epk-decryption/reports/
- store_test_results:
path: packages/lit-protocol-cipher/reports/
- store_test_results:
path: packages/multi-format/reports/
- store_test_results:
path: packages/request-logic/reports/
- store_test_results:
path: packages/thegraph-data-access/reports/
- store_test_results:
path: packages/transaction-manager/reports/
- store_test_results:
path: packages/utils/reports/
- store_test_results:
path: packages/web3-signature/reports/
test-integration-with-smart-contracts:
docker:
- *node_image
- *ipfs_image
- *ganache_image
- *postgres_image
- *graph_image
resource_class: xlarge
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Deploy test contract from smart-contracts'
command: 'yarn deploy:contracts'
- run: *step_graph_deploy
- run:
name: 'Test request-client.js, smart-contracts, payment-detection and payment-processor'
command: |
yarn test \
--scope @requestnetwork/request-node \
--scope @requestnetwork/ethereum-storage \
--scope @requestnetwork/request-client.js \
--scope @requestnetwork/smart-contracts \
--scope @requestnetwork/payment-detection \
--scope @requestnetwork/payment-processor \
--concurrency=1
- store_test_results:
path: packages/request-node/reports/
- store_test_results:
path: packages/request-client.js/reports/
- store_test_results:
path: packages/smart-contracts/reports/
- store_test_results:
path: packages/payment-detection/reports/
- store_test_results:
path: packages/payment-processor/reports/
- store_test_results:
path: packages/ethereum-storage/reports/
test-integration-with-request-node:
docker:
- *node_image
- *ipfs_image
- *ganache_image
- *postgres_image
- *graph_image
resource_class: large
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Deploy test contract from smart-contracts'
command: 'yarn deploy:contracts'
- run: *step_graph_deploy
- run:
name: 'Start request-node'
command: 'yarn start:request-node'
background: true
- run: *step_wait_for_node
- run:
name: 'Test integration-test'
command: |
yarn test \
--scope @requestnetwork/integration-test
- store_test_results:
path: packages/integration-test/reports/
test-usage-examples:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build usage-examples'
command: 'yarn workspace @requestnetwork/usage-examples run build'
- run:
name: 'Execute usage-examples'
command: 'yarn workspace @requestnetwork/usage-examples run start'
test-toolbox:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build toolbox'
command: 'yarn workspace @requestnetwork/toolbox run build'
test-nightly:
docker:
- *node_image
- *ipfs_image
- *ganache_image
- *postgres_image
- *graph_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Deploy test contract from smart-contracts'
command: 'yarn deploy:contracts'
- run: *step_graph_deploy
- run:
name: 'Start request-node'
command: 'yarn start:request-node'
background: true
- run: *step_wait_for_node
- run:
name: 'Test integration-test (erc20)'
command: 'yarn workspace @requestnetwork/integration-test run test:erc20'
- run:
name: 'Test integration-test (btc)'
command: 'yarn workspace @requestnetwork/integration-test run test:btc'
- store_test_results:
path: packages/integration-test/reports/
test-monthly:
docker:
- *node_image
working_directory: *working_directory
resource_class: large
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Test payment-processor (hinkal)'
no_output_timeout: 30m
command: 'yarn workspace @requestnetwork/payment-processor run test:hinkal'
- store_test_results:
path: packages/payment-processor/reports/
# Release a next version package everytime we merge to master
next-release:
docker:
- *node_image
working_directory: *working_directory
resource_class: large
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Allow github ssh host'
command: mkdir ~/.ssh; echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
- run:
name: 'Authenticate with registry'
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: 'Publish'
command: yarn run publish-prerelease
workflows:
## Lerna will run lint, build and test
build-and-test:
jobs:
- build
- test-unit:
requires:
- build
- test-integration-with-smart-contracts:
requires:
- build
- test-integration-with-request-node:
requires:
- build
- test-usage-examples:
requires:
- build
- test-toolbox:
requires:
- build
- lint:
requires:
- build
# Release a next version package everytime we merge to master
- next-release:
requires:
- lint
- build
- test-unit
- test-integration-with-smart-contracts
- test-integration-with-request-node
- test-usage-examples
- test-toolbox
context: protocol-release
filters:
branches:
only:
- master
nightly:
triggers:
- schedule:
# This is a cron job for "everyday at 22 hours"
cron: '0 22 * * *'
filters:
branches:
only:
- master
jobs:
- build
- test-nightly:
requires:
- build
monthly:
triggers:
- schedule:
# This is a cron job for "every 1st day of the month at 22 hours"
cron: '0 22 1 * *'
filters:
branches:
only:
- master
jobs:
- build
- test-monthly:
requires:
- build