Skip to content

Commit

Permalink
Merge branch 'master' into docs-non-evm-payments
Browse files Browse the repository at this point in the history
  • Loading branch information
MantisClone committed Oct 5, 2023
2 parents ed1f58d + 6741198 commit 59e5776
Show file tree
Hide file tree
Showing 927 changed files with 236,588 additions and 42,183 deletions.
166 changes: 120 additions & 46 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,59 @@ version: 2.1
references:
working_directory: &working_directory ~/repo
attach_workspace: &attach_workspace
image_name: &image_name 'circleci/python:3.7'
image_name: &image_name 'cimg/python:3.7'
node_image: &node_image
image: circleci/node:14
image: cimg/node:16.15
ipfs_image: &ipfs_image
image: requestnetwork/request-ipfs
image: requestnetwork/request-ipfs:v0.13.0
ganache_image: &ganache_image
image: trufflesuite/ganache-cli:v6.8.2
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:
Expand All @@ -40,7 +80,7 @@ jobs:
command: yarn format:check
- run:
name: Verify lint
command: yarn lint
command: yarn lint:check
- run:
name: Build types
command: yarn workspace @requestnetwork/types run build
Expand All @@ -57,6 +97,10 @@ jobs:
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: .
Expand Down Expand Up @@ -86,7 +130,7 @@ jobs:
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test request-client.js'
command: 'yarn workspace @requestnetwork/request-client.js run test'
command: 'yarn workspace @requestnetwork/request-client.js run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -103,7 +147,7 @@ jobs:
command: 'yarn workspace @requestnetwork/data-access run build'
- run:
name: 'Test data-access'
command: 'yarn workspace @requestnetwork/data-access run test'
command: 'yarn workspace @requestnetwork/data-access run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -120,7 +164,7 @@ jobs:
command: 'yarn workspace @requestnetwork/data-format run build'
- run:
name: 'Test data-format'
command: 'yarn workspace @requestnetwork/data-format run test'
command: 'yarn workspace @requestnetwork/data-format run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -137,7 +181,7 @@ jobs:
command: 'yarn workspace @requestnetwork/transaction-manager run build'
- run:
name: 'Test transaction-manager'
command: 'yarn workspace @requestnetwork/transaction-manager run test'
command: 'yarn workspace @requestnetwork/transaction-manager run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -159,7 +203,7 @@ jobs:
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test ethereum-storage'
command: 'yarn workspace @requestnetwork/ethereum-storage run test'
command: 'yarn workspace @requestnetwork/ethereum-storage run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -177,13 +221,13 @@ jobs:
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Lint smart contracts smart-contracts'
command: 'yarn workspace @requestnetwork/smart-contracts run lint:sol'
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'
command: 'yarn workspace @requestnetwork/smart-contracts run test:lib --ci --maxWorkers=1'
test-request-logic:
docker:
- *node_image
Expand All @@ -196,7 +240,7 @@ jobs:
command: 'yarn workspace @requestnetwork/request-logic run build'
- run:
name: 'Test request-logic'
command: 'yarn workspace @requestnetwork/request-logic run test'
command: 'yarn workspace @requestnetwork/request-logic run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -213,7 +257,7 @@ jobs:
command: 'yarn workspace @requestnetwork/advanced-logic run build'
- run:
name: 'Test advanced-logic'
command: 'yarn workspace @requestnetwork/advanced-logic run test'
command: 'yarn workspace @requestnetwork/advanced-logic run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -223,6 +267,8 @@ jobs:
- *node_image
- *ipfs_image
- *ganache_image
- *postgres_image
- *graph_image
working_directory: *working_directory
steps:
- attach_workspace:
Expand All @@ -233,23 +279,25 @@ jobs:
- 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'
command: 'yarn workspace @requestnetwork/request-node run test --ci'
- persist_to_workspace:
root: *working_directory
paths:
- packages/request-node/coverage/
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'
command: 'yarn workspace @requestnetwork/utils run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -263,7 +311,7 @@ jobs:
at: *working_directory
- run:
name: 'Test currency'
command: 'yarn workspace @requestnetwork/currency run test'
command: 'yarn workspace @requestnetwork/currency run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -280,7 +328,7 @@ jobs:
command: 'yarn workspace @requestnetwork/epk-signature run build'
- run:
name: 'Test epk-signature'
command: 'yarn workspace @requestnetwork/epk-signature run test'
command: 'yarn workspace @requestnetwork/epk-signature run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -297,7 +345,7 @@ jobs:
command: 'yarn workspace @requestnetwork/epk-decryption run build'
- run:
name: 'Test epk-decryption'
command: 'yarn workspace @requestnetwork/epk-decryption run test'
command: 'yarn workspace @requestnetwork/epk-decryption run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -314,7 +362,7 @@ jobs:
command: 'yarn workspace @requestnetwork/web3-signature run build'
- run:
name: 'Test web3-signature'
command: 'yarn workspace @requestnetwork/web3-signature run test'
command: 'yarn workspace @requestnetwork/web3-signature run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -338,19 +386,51 @@ jobs:
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'
# This test runs the node-client tests against a node backed by TheGraph data access
test-integration-graph-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 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
environment:
GRAPH_NODE_URL: http://localhost:8000/subgraphs/name/RequestNetwork/request-storage
- run: *step_wait_for_node
- run:
name: 'Waiting for Request Node to be ready'
name: 'Confirm TheGraph mode'
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
NODE_ENDPOINT=$(wget -O- http://localhost:3000/status | jq .dataAccess.endpoint -r)
if [ "$NODE_ENDPOINT" != "http://localhost:8000/subgraphs/name/RequestNetwork/request-storage" ] ; then
print "Graph node URL mismatch"
print $NODE_ENDPOINT
exit 1
fi
- run:
name: 'Test integration-test'
command: 'yarn workspace @requestnetwork/integration-test run test'
command: 'yarn workspace @requestnetwork/integration-test run test:node'
test-usage-examples:
docker:
- *node_image
Expand Down Expand Up @@ -386,7 +466,7 @@ jobs:
command: 'yarn workspace @requestnetwork/multi-format run build'
- run:
name: 'Test multi-format'
command: 'yarn workspace @requestnetwork/multi-format run test'
command: 'yarn workspace @requestnetwork/multi-format run test --ci --maxWorkers=1'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -407,7 +487,7 @@ jobs:
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test payment-detection'
command: 'yarn workspace @requestnetwork/payment-detection run test'
command: 'yarn workspace @requestnetwork/payment-detection run test --ci'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -428,7 +508,7 @@ jobs:
command: 'yarn workspace @requestnetwork/smart-contracts run deploy'
- run:
name: 'Test payment-processor'
command: 'yarn workspace @requestnetwork/payment-processor run test'
command: 'yarn workspace @requestnetwork/payment-processor run test --ci'
- persist_to_workspace:
root: *working_directory
paths:
Expand All @@ -443,16 +523,6 @@ jobs:
- run:
name: 'Publish Coverage'
command: 'yarn publish-coverage'
test-prototype-estimator:
docker:
- *node_image
working_directory: *working_directory
steps:
- attach_workspace:
at: *working_directory
- run:
name: 'Build prototype-estimator'
command: 'yarn workspace @requestnetwork/prototype-estimator run build'
test-nightly:
docker:
- *node_image
Expand Down Expand Up @@ -483,8 +553,11 @@ jobs:
done
echo Failed waiting for Node initialization && exit 1
- run:
name: 'Test integration-test'
command: 'yarn workspace @requestnetwork/integration-test run test:scheduled'
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:
Expand Down Expand Up @@ -586,7 +659,7 @@ workflows:
- test-integration-test:
requires:
- build
- test-prototype-estimator:
- test-integration-graph-node:
requires:
- build
- test-payment-detection:
Expand Down Expand Up @@ -626,6 +699,7 @@ workflows:
- test-epk-signature
- test-ethereum-storage
- test-integration-test
- test-integration-graph-node
- test-smart-contracts
- test-multi-format
- test-request-client
Expand Down

0 comments on commit 59e5776

Please sign in to comment.