From 6bb04e0db0f956f1daebbaeee9828855431eb562 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 26 Apr 2024 13:35:48 +0200 Subject: [PATCH 1/4] Use nitro-contracts and token-bridge branches only if explicitly provided --- run-nitro-test-node/action.yml | 48 +++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/run-nitro-test-node/action.yml b/run-nitro-test-node/action.yml index e11c470..a07ca03 100644 --- a/run-nitro-test-node/action.yml +++ b/run-nitro-test-node/action.yml @@ -1,47 +1,45 @@ name: Run Nitro Test Node -description: 'Checks out the Nitro repository and runs the local test node setup' +description: "Checks out the Nitro repository and runs the local test node setup" inputs: no-token-bridge: required: false - default: 'false' - description: 'Whether to skip deploying the token bridge on the test node' + 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' + 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' + 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' + default: "" + description: "Additional args that can be supplied to the test node script" nitro-testnode-ref: required: false - default: 'release' - description: 'The nitro-testnode branch to use' + default: "release" + description: "The nitro-testnode branch to use" l3-node: required: false - default: 'false' - description: 'Whether to start an L3 node in addition to the L2 node' + default: "false" + description: "Whether to start an L3 node in addition to the L2 node" nitro-contracts-branch: required: false - default: 'main' - description: 'The nitro-contracts branch to use' + description: "The nitro-contracts branch/tag/commit to use" token-bridge-branch: required: false - default: 'main' - description: 'The token-bridge-contracts branch to use' + description: "The token-bridge-contracts branch/tag/commit to use" runs: - using: 'composite' + using: "composite" steps: - name: Checkout uses: actions/checkout@v3 with: repository: OffchainLabs/nitro-testnode submodules: true - path: 'nitro-testnode' + path: "nitro-testnode" ref: ${{ inputs.nitro-testnode-ref }} - name: Start background nitro-testnode test-node.bash @@ -51,8 +49,16 @@ runs: # See https://stackoverflow.com/a/72203688 for more info run: | cd nitro-testnode - NITRO_CONTRACTS_BRANCH=${{ inputs.nitro-contracts-branch }} TOKEN_BRIDGE_BRANCH=${{ inputs.token-bridge-branch }} \ - ./test-node.bash --init ${{ inputs.no-simple == 'true' && '--no-simple' || '' }} \ + + if [ -n "${{ inputs.nitro-contracts-branch }}" ]; then + export NITRO_CONTRACTS_BRANCH="${{ inputs.nitro-contracts-branch }}" + fi + + if [ -n "${{ inputs.token-bridge-branch }}" ]; then + export TOKEN_BRIDGE_BRANCH="${{ inputs.token-bridge-branch }}" + fi + + ./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' || '' }} \ From 7e300588db23630b46796bdf45702e50522f903e Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 26 Apr 2024 14:40:15 +0200 Subject: [PATCH 2/4] Set original formatting --- run-nitro-test-node/action.yml | 37 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/run-nitro-test-node/action.yml b/run-nitro-test-node/action.yml index a07ca03..b9104de 100644 --- a/run-nitro-test-node/action.yml +++ b/run-nitro-test-node/action.yml @@ -1,45 +1,45 @@ name: Run Nitro Test Node -description: "Checks out the Nitro repository and runs the local test node setup" +description: 'Checks out the Nitro repository and runs the local test node setup' inputs: no-token-bridge: required: false - default: "false" - description: "Whether to skip deploying the token bridge on the test node" + 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" + 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" + 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" + default: '' + description: 'Additional args that can be supplied to the test node script' nitro-testnode-ref: required: false - default: "release" - description: "The nitro-testnode branch to use" + default: 'release' + description: 'The nitro-testnode branch to use' l3-node: required: false - default: "false" - description: "Whether to start an L3 node in addition to the L2 node" + default: 'false' + description: 'Whether to start an L3 node in addition to the L2 node' nitro-contracts-branch: required: false - description: "The nitro-contracts branch/tag/commit to use" + description: 'The nitro-contracts branch to use' token-bridge-branch: required: false - description: "The token-bridge-contracts branch/tag/commit to use" + description: 'The token-bridge-contracts branch to use' runs: - using: "composite" + using: 'composite' steps: - name: Checkout uses: actions/checkout@v3 with: repository: OffchainLabs/nitro-testnode submodules: true - path: "nitro-testnode" + path: 'nitro-testnode' ref: ${{ inputs.nitro-testnode-ref }} - name: Start background nitro-testnode test-node.bash @@ -53,7 +53,6 @@ runs: if [ -n "${{ inputs.nitro-contracts-branch }}" ]; then export NITRO_CONTRACTS_BRANCH="${{ inputs.nitro-contracts-branch }}" fi - if [ -n "${{ inputs.token-bridge-branch }}" ]; then export TOKEN_BRIDGE_BRANCH="${{ inputs.token-bridge-branch }}" fi @@ -81,4 +80,4 @@ runs: - 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 + run: ${{ github.action_path }}/waitForTokenBridge.sh l2l3_network.json \ No newline at end of file From 16c1de251f9bdda8629dfac0088c7d7e87a73ec0 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 26 Apr 2024 15:09:19 +0200 Subject: [PATCH 3/4] Temp commit to test local CI --- .github/workflows/run-nitro-test-node.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/run-nitro-test-node.yml b/.github/workflows/run-nitro-test-node.yml index ba0cc05..ef8fdf6 100644 --- a/.github/workflows/run-nitro-test-node.yml +++ b/.github/workflows/run-nitro-test-node.yml @@ -11,6 +11,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./run-nitro-test-node + with: + nitro-testnode-ref: 'default-versions' run-with-token-bridge: name: 'Run without token bridge deployment' @@ -20,6 +22,7 @@ jobs: - uses: ./run-nitro-test-node with: no-token-bridge: true + nitro-testnode-ref: 'default-versions' run-with-args: name: 'Run with args' @@ -29,6 +32,7 @@ jobs: - uses: ./run-nitro-test-node with: args: --detach + nitro-testnode-ref: 'default-versions' run-with-simple: name: 'Run in simple mode' @@ -38,4 +42,5 @@ jobs: - uses: ./run-nitro-test-node with: no-simple: false + nitro-testnode-ref: 'default-versions' From 209d0c37df0157d9c315a7aa21393965131cce32 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Fri, 26 Apr 2024 15:20:52 +0200 Subject: [PATCH 4/4] Remove --- .github/workflows/run-nitro-test-node.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/run-nitro-test-node.yml b/.github/workflows/run-nitro-test-node.yml index ef8fdf6..cd7b3be 100644 --- a/.github/workflows/run-nitro-test-node.yml +++ b/.github/workflows/run-nitro-test-node.yml @@ -11,8 +11,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./run-nitro-test-node - with: - nitro-testnode-ref: 'default-versions' run-with-token-bridge: name: 'Run without token bridge deployment' @@ -22,7 +20,6 @@ jobs: - uses: ./run-nitro-test-node with: no-token-bridge: true - nitro-testnode-ref: 'default-versions' run-with-args: name: 'Run with args' @@ -32,7 +29,6 @@ jobs: - uses: ./run-nitro-test-node with: args: --detach - nitro-testnode-ref: 'default-versions' run-with-simple: name: 'Run in simple mode' @@ -42,5 +38,3 @@ jobs: - uses: ./run-nitro-test-node with: no-simple: false - nitro-testnode-ref: 'default-versions' -