-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathconfig.yml
More file actions
257 lines (251 loc) · 7.94 KB
/
config.yml
File metadata and controls
257 lines (251 loc) · 7.94 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
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
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: large
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 (lerna)
command: yarn build --skip-nx-cache
- 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: 'lint package.json files'
command: 'yarn run packageJsonLint'
test:
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 workspace @requestnetwork/smart-contracts run deploy'
- run: *step_graph_deploy
- run:
name: 'Start request-node'
command: 'yarn start:request-node'
background: true
- run: *step_wait_for_node
- run:
name: 'Test all'
command: 'yarn test'
- store_test_results:
path: packages/integration-test/reports/
- store_test_results:
path: packages/lit-protocol-cipher/reports/
- store_test_results:
path: packages/request-client.js/reports/
- store_test_results:
path: packages/request-logic/reports/
- store_test_results:
path: packages/request-node/reports/
- store_test_results:
path: packages/smart-contracts/reports/
- store_test_results:
path: packages/transaction-manager/reports/
- store_test_results:
path: packages/epk-signature/reports/
- store_test_results:
path: packages/web3-signature/reports/
- store_test_results:
path: packages/payment-detection/reports/
- store_test_results:
path: packages/payment-processor/reports/
- store_test_results:
path: packages/advanced-logic/reports/
- store_test_results:
path: packages/data-access/reports/
- store_test_results:
path: packages/ethereum-storage/reports/
- store_test_results:
path: packages/epk-decryption/reports/
- store_test_results:
path: packages/thegraph-data-access/reports/
- store_test_results:
path: packages/currency/reports/
- store_test_results:
path: packages/utils/reports/
- store_test_results:
path: packages/multi-format/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'
# 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
- 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 \
--no-git-tag-version \
--no-push \
--preid next \
--no-verify-access \
--dist-tag next \
--yes \
--force-publish=${FORCE_PUBLISH}
workflows:
## Lerna will run lit, build and test
build-and-test:
jobs:
- test
- lint:
requires:
- test
- test-usage-examples:
requires:
- test
- test-toolbox:
requires:
- test
# Release a next version package everytime we merge to master
- next-release:
requires:
- test
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:
requires:
- build