From 1336937dce646371daed467942b4d1c57c29aaae Mon Sep 17 00:00:00 2001 From: Henry <11198460+godzillaba@users.noreply.github.com> Date: Mon, 5 Feb 2024 06:15:42 -0500 Subject: [PATCH] add no-l3-token-bridge arg (#19) * 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 --- .github/workflows/run-nitro-test-node.yml | 9 +++++++++ run-nitro-test-node/action.yml | 23 ++++++++++++++++++++--- run-nitro-test-node/waitForTokenBridge.sh | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-nitro-test-node.yml b/.github/workflows/run-nitro-test-node.yml index 67a5b81..ba0cc05 100644 --- a/.github/workflows/run-nitro-test-node.yml +++ b/.github/workflows/run-nitro-test-node.yml @@ -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 + diff --git a/run-nitro-test-node/action.yml b/run-nitro-test-node/action.yml index 7c5d796..4a4bba5 100644 --- a/run-nitro-test-node/action.yml +++ b/run-nitro-test-node/action.yml @@ -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 @@ -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 @@ -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 diff --git a/run-nitro-test-node/waitForTokenBridge.sh b/run-nitro-test-node/waitForTokenBridge.sh index 68f403c..e7c710a 100755 --- a/run-nitro-test-node/waitForTokenBridge.sh +++ b/run-nitro-test-node/waitForTokenBridge.sh @@ -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