Skip to content

Commit

Permalink
add no-l3-token-bridge arg (#19)
Browse files Browse the repository at this point in the history
* add no-l3-token-bridge arg

* l3 token bridge only if l3-node is true

* breaking change, change file that waitForTokenBridge looks for

* feat: no-simple and backward compatibility

---------

Co-authored-by: gzeon <[email protected]>
  • Loading branch information
godzillaba and gzeoneth authored Feb 5, 2024
1 parent d5dc1e1 commit 1336937
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/run-nitro-test-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ jobs:
with:
args: --detach

run-with-simple:
name: 'Run in simple mode'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./run-nitro-test-node
with:
no-simple: false

23 changes: 20 additions & 3 deletions run-nitro-test-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@ inputs:
required: false
default: 'false'
description: 'Whether to skip deploying the token bridge on the test node'
no-l3-token-bridge:
required: false
default: 'false'
description: 'Whether to skip deploying the L3 token bridge on the test node'
no-simple:
required: false
default: 'true'
description: 'Whether to start the test node in simple mode'
args:
required: false
default: ''
description: 'Additional args that can be supplied to the test node script'
nitro-testnode-ref:
required: false
default: 'old-release-v2.1.1'
default: 'release'
description: 'The nitro-testnode branch to use'
l3-node:
required: false
Expand All @@ -35,7 +43,11 @@ runs:
# See https://stackoverflow.com/a/72203688 for more info
run: |
cd nitro-testnode
./test-node.bash --init ${{ inputs.l3-node == 'true' && '--l3node' || '' }} ${{ inputs.no-token-bridge == 'true' && '--no-tokenbridge' || '' }} ${{ inputs.args }} &
./test-node.bash --init ${{ inputs.no-simple == 'true' && '--no-simple' || '' }} \
${{ inputs.l3-node == 'true' && '--l3node' || '' }} \
${{ inputs.no-token-bridge == 'true' && '--no-tokenbridge' || '--tokenbridge' }} \
${{ inputs.l3-node == 'true' && inputs.no-l3-token-bridge != 'true' && '--l3-token-bridge' || '' }} \
${{ inputs.args }} &
- name: Wait for nitro startup
shell: bash
Expand All @@ -49,4 +61,9 @@ runs:
- name: Wait for token bridge deployment
if: ${{ inputs.no-token-bridge != 'true' }}
shell: bash
run: ${{ github.action_path }}/waitForTokenBridge.sh
run: ${{ github.action_path }}/waitForTokenBridge.sh localNetwork.json

- name: Wait for token bridge deployment
if: ${{ inputs.l3-node == 'true' && inputs.no-l3-token-bridge != 'true' }}
shell: bash
run: ${{ github.action_path }}/waitForTokenBridge.sh l2l3_network.json
2 changes: 1 addition & 1 deletion run-nitro-test-node/waitForTokenBridge.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# poll the token bridge deployment file until we get a 0 return code
while true
do
docker-compose -f ./nitro-testnode/docker-compose.yaml run --entrypoint sh tokenbridge -c "cat localNetwork.json"
docker-compose -f ./nitro-testnode/docker-compose.yaml run --entrypoint sh tokenbridge -c "cat $1"
if [ "$?" -eq "0" ]; then
exit 0
else
Expand Down

0 comments on commit 1336937

Please sign in to comment.