Skip to content

Commit

Permalink
Enable CI
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgcyx committed Nov 21, 2023
1 parent 7c97779 commit 8629531
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: End to End Test

on: [push]

jobs:
build:
name: End to End Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run build
uses: borales/actions-yarn@v4
with:
cmd: build

- name: Run Test
uses: borales/actions-yarn@v4
with:
cmd: local:ci
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"local:start": "cd scripts/localdev; ./start.sh",
"local:setup": "cd scripts/localdev; ./deploy.sh",
"local:test": "cd scripts/localdev; npx mocha --require mocha-suppress-logs ../e2e/",
"local:ci": "cd scripts/localdev; ./ci.sh",
"local:chainonly": "cd scripts/localdev; LOCAL_CHAIN_ONLY=true ./start.sh",
"local:axelaronly": "cd scripts/localdev; node axelar_setup.js",
"stop": "cd scripts/localdev; ./stop.sh"
Expand Down
20 changes: 20 additions & 0 deletions scripts/localdev/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

./start.sh &

# Try at most 300 seconds
counter=1
while [ $counter -le 300 ]
do
echo "Waiting for chain and axelar setup... ${counter}"
SKIP_WAIT_FOR_CONFIRMATION=true SKIP_MULTISIG_CHECK=true node ../bootstrap/2_deployment_validation.js > /dev/null 2>&1
if [ $? -ne 0 ]; then
sleep 1
((counter++))
continue
fi
break
done

./deploy.sh
npx mocha --require mocha-suppress-logs ../e2e/
23 changes: 22 additions & 1 deletion scripts/localdev/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,42 @@

# Verify deployment
SKIP_WAIT_FOR_CONFIRMATION=true SKIP_MULTISIG_CHECK=true node ../bootstrap/2_deployment_validation.js
if [ $? -ne 0 ]; then
exit 1;
fi

# Deploy child contracts
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/3_child_deployment.js
if [ $? -ne 0 ]; then
exit 1;
fi

# Deploy root contracts
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/4_root_deployment.js
if [ $? -ne 0 ]; then
exit 1;
fi

# Initialise child contracts
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/5_child_initialisation.js
if [ $? -ne 0 ]; then
exit 1;
fi

# IMX Burning
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/6_imx_burning.js
if [ $? -ne 0 ]; then
exit 1;
fi

# IMX Rebalancing
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/7_imx_rebalancing.js
if [ $? -ne 0 ]; then
exit 1;
fi

# Initialise root contracts
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/8_root_initialisation.js
SKIP_WAIT_FOR_CONFIRMATION=true node ../bootstrap/8_root_initialisation.js
if [ $? -ne 0 ]; then
exit 1;
fi

0 comments on commit 8629531

Please sign in to comment.