-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathconfig.yml
More file actions
646 lines (640 loc) · 20.7 KB
/
config.yml
File metadata and controls
646 lines (640 loc) · 20.7 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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
version: 2.1
references:
working_directory: &working_directory ~/repo
attach_workspace: &attach_workspace
image_name: &image_name 'cimg/python:3.7'
node_image: &node_image
image: cimg/node:18.18
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
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 types
command: yarn workspace @requestnetwork/types run build
- run:
name: Build utils
command: yarn workspace @requestnetwork/utils run build
- run:
name: Build chain
command: yarn workspace @requestnetwork/chain run build
- run:
name: Build currency
command: yarn workspace @requestnetwork/currency run build
- run:
name: Generate Smart Contract types
command: yarn workspace @requestnetwork/smart-contracts run build
- run:
name: Generate Payment Detection queries
command: yarn workspace @requestnetwork/payment-detection run codegen
- run:
name: Build all packages (tsc)
command: yarn build:tsc
- persist_to_workspace:
root: *working_directory
paths:
- ./
lint:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: Verify format
command: yarn format:check
- run:
name: Verify lint
command: yarn lint:check
- run:
name: 'lint package.json files'
command: 'yarn run packageJsonLint'
test-request-client:
docker:
- *node_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build request-client.js'
command: 'yarn workspace @requestnetwork/request-client.js run build:commonjs'
- run:
name: 'Deploy test contracts from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test request-client.js'
command: 'yarn workspace @requestnetwork/request-client.js run test --ci --maxWorkers=1'
- store_test_results:
path: packages/request-client.js/reports/
test-data-access:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build data-access'
command: 'yarn workspace @requestnetwork/data-access run build'
- run:
name: 'Test data-access'
command: 'yarn workspace @requestnetwork/data-access run test --ci --maxWorkers=1'
- store_test_results:
path: packages/data-access/reports/
test-data-format:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build data-format'
command: 'yarn workspace @requestnetwork/data-format run build'
- run:
name: 'Test data-format'
command: 'yarn workspace @requestnetwork/data-format run test --ci --maxWorkers=1'
- store_test_results:
path: packages/data-format/reports/
test-transaction-manager:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build transaction-manager'
command: 'yarn workspace @requestnetwork/transaction-manager run build'
- run:
name: 'Test transaction-manager'
command: 'yarn workspace @requestnetwork/transaction-manager run test --ci --maxWorkers=1'
- store_test_results:
path: packages/transaction-manager/reports/
test-ethereum-storage:
docker:
- *node_image
- *ipfs_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build ethereum-storage'
command: 'yarn workspace @requestnetwork/ethereum-storage run build'
- run:
name: 'Deploy contracs smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test ethereum-storage'
command: 'yarn workspace @requestnetwork/ethereum-storage run test --ci --maxWorkers=1'
- store_test_results:
path: packages/ethereum-storage/reports/
test-smart-contracts:
docker:
- *node_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Deploy contracs smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Lint smart contracts smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run lint:sol:check'
- run:
name: 'Test smart contracts smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run test'
- run:
name: 'Test smart contracts utilities'
command: 'yarn workspace @requestnetwork/smart-contracts run test:lib --ci --maxWorkers=1'
test-request-logic:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build request-logic'
command: 'yarn workspace @requestnetwork/request-logic run build'
- run:
name: 'Test request-logic'
command: 'yarn workspace @requestnetwork/request-logic run test --ci --maxWorkers=1'
- store_test_results:
path: packages/request-logic/reports/
test-advanced-logic:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build advanced-logic'
command: 'yarn workspace @requestnetwork/advanced-logic run build'
- run:
name: 'Test advanced-logic'
command: 'yarn workspace @requestnetwork/advanced-logic run test --ci --maxWorkers=1'
- store_test_results:
path: packages/advanced-logic/reports/
test-request-node:
docker:
- *node_image
- *ipfs_image
- *ganache_image
- *postgres_image
- *graph_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build request-node'
command: 'yarn workspace @requestnetwork/request-node run build'
- run:
name: 'Deploy test contract from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run: *step_graph_deploy
- run:
name: 'Test request-node'
command: 'yarn workspace @requestnetwork/request-node run test --ci'
- store_test_results:
path: packages/request-node/reports/
test-utils:
docker:
- *node_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Test utils'
command: 'yarn workspace @requestnetwork/utils run test --ci --maxWorkers=1'
- store_test_results:
path: packages/utils/reports/
test-chain:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Test chain'
command: 'yarn workspace @requestnetwork/chain run test --ci --maxWorkers=1'
- store_test_results:
path: packages/chain/reports/
test-currency:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Test currency'
command: 'yarn workspace @requestnetwork/currency run test --ci --maxWorkers=1'
- store_test_results:
path: packages/currency/reports/
test-epk-signature:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build epk-signature'
command: 'yarn workspace @requestnetwork/epk-signature run build'
- run:
name: 'Test epk-signature'
command: 'yarn workspace @requestnetwork/epk-signature run test --ci --maxWorkers=1'
- store_test_results:
path: packages/epk-signature/reports/
test-epk-decryption:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build epk-decryption'
command: 'yarn workspace @requestnetwork/epk-decryption run build'
- run:
name: 'Test epk-decryption'
command: 'yarn workspace @requestnetwork/epk-decryption run test --ci --maxWorkers=1'
- store_test_results:
path: packages/epk-decryption/reports/
test-web3-signature:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build web3-signature'
command: 'yarn workspace @requestnetwork/web3-signature run build'
- run:
name: 'Test web3-signature'
command: 'yarn workspace @requestnetwork/web3-signature run test --ci --maxWorkers=1'
- store_test_results:
path: packages/web3-signature/reports/
test-integration-test:
docker:
- *node_image
- *ipfs_image
- *ganache_image
- *postgres_image
- *graph_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build integration-test'
command: 'yarn workspace @requestnetwork/integration-test run build'
- run:
name: 'Deploy test contract from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run: *step_graph_deploy
- run:
name: 'Start request-node'
command: 'yarn workspace @requestnetwork/request-node run start'
background: true
- run: *step_wait_for_node
- run:
name: 'Test integration-test (node)'
command: 'yarn workspace @requestnetwork/integration-test run test:node --ci --maxWorkers=1'
- run:
name: 'Test integration-test (layers)'
command: 'yarn workspace @requestnetwork/integration-test run test:layers --ci --maxWorkers=1'
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-multi-format:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build multi-format'
command: 'yarn workspace @requestnetwork/multi-format run build'
- run:
name: 'Test multi-format'
command: 'yarn workspace @requestnetwork/multi-format run test --ci --maxWorkers=1'
- store_test_results:
path: packages/multi-format/reports/
test-payment-detection:
docker:
- *node_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build payment-detection'
command: 'yarn workspace @requestnetwork/payment-detection run build'
- run:
name: 'Deploy test contracts from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test payment-detection'
command: 'yarn workspace @requestnetwork/payment-detection run test --ci'
- store_test_results:
path: packages/payment-detection/reports/
test-payment-processor:
docker:
- *node_image
- *ganache_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build payment-processor'
command: 'yarn workspace @requestnetwork/payment-processor run build'
- run:
name: 'Deploy test contracts from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test payment-processor'
command: 'yarn workspace @requestnetwork/payment-processor run test --ci'
- store_test_results:
path: packages/payment-processor/reports/
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: 'Build integration-test'
command: 'yarn workspace @requestnetwork/integration-test run build'
- run:
name: 'Deploy test contract from smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run: *step_graph_deploy
- run:
name: 'Start request-node'
command: 'yarn workspace @requestnetwork/request-node run start'
background: true
- run: *step_wait_for_node
- run:
name: 'Test integration-test (erc20)'
command: 'yarn workspace @requestnetwork/integration-test run test:erc20 --ci --maxWorkers=1'
- run:
name: 'Test integration-test (btc)'
command: 'yarn workspace @requestnetwork/integration-test run test:btc --ci --maxWorkers=1'
# Release a next version package everytime we merge to master
next-release:
docker:
- *node_image
working_directory: *working_directory
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
# this build step shouldn't be necessary because publishing already builds,
# but without it, some packages like epk-signature are missing the dist folder.
- run:
name: 'Build all'
command: 'yarn build'
- run:
name: 'Authenticate with registry'
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: 'Publish'
command: |
FORCE_PUBLISH=$($(yarn bin)/lerna changed --json | jq '. | map(.name) | join (",")' -r)
echo $FORCE_PUBLISH
$(yarn bin)/lerna publish \
--conventional-commits \
--conventional-prerelease \
--exact \
--canary \
--no-git-tag-version \
--no-push \
--preid next \
--no-verify-access \
--dist-tag next \
--yes \
--force-publish=${FORCE_PUBLISH}
workflows:
version: 2
build-and-test:
jobs:
- build
- lint:
requires:
- build
# Test
- test-request-client:
requires:
- build
- test-transaction-manager:
requires:
- build
- test-data-access:
requires:
- build
- test-data-format:
requires:
- build
- test-ethereum-storage:
requires:
- build
- test-smart-contracts:
requires:
- build
- test-request-logic:
requires:
- build
- test-multi-format:
requires:
- build
- test-advanced-logic:
requires:
- build
- test-request-node:
requires:
- build
- test-utils:
requires:
- build
- test-chain:
requires:
- build
- test-currency:
requires:
- build
- test-epk-signature:
requires:
- build
- test-epk-decryption:
requires:
- build
- test-web3-signature:
requires:
- build
- test-usage-examples:
requires:
- build
- test-toolbox:
requires:
- build
- test-integration-test:
requires:
- build
- test-payment-detection:
requires:
- build
- test-payment-processor:
requires:
- build
# Release a next version package everytime we merge to master
- next-release:
requires:
- lint
- test-advanced-logic
- test-chain
- test-currency
- test-data-access
- test-data-format
- test-epk-decryption
- test-epk-signature
- test-ethereum-storage
- test-integration-test
- test-multi-format
- test-payment-detection
- test-payment-processor
- test-request-client
- test-request-logic
- test-request-node
- test-smart-contracts
- test-transaction-manager
- test-utils
- test-web3-signature
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