Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(testnode): remove inputs and just use args #29

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions .github/workflows/run-nitro-test-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,44 @@ on:

jobs:
run-with-defaults:
name: "Run with defaults"
name: 'Run with defaults'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./run-nitro-test-node

run-with-token-bridge:
name: "Run without token bridge deployment"
name: 'Run with token bridge deployment'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./run-nitro-test-node
with:
no-token-bridge: true
args: --tokenbridge

run-with-args:
name: "Run with args"
run-with-l3:
name: 'Run with L3'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./run-nitro-test-node
with:
args: --detach
args: --tokenbridge --l3node

run-with-simple:
name: "Run in simple mode"
run-with-l3-with-token-bridge:
name: 'Run with L3 with token bridge deployment'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./run-nitro-test-node
with:
no-simple: false
args: --tokenbridge --l3node --l3-token-bridge

run-with-no-simple:
name: 'Run with --no-simple mode'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./run-nitro-test-node
with:
args: --no-simple
58 changes: 19 additions & 39 deletions run-nitro-test-node/action.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,29 @@
name: Run Nitro Test Node
description: "Checks out the Nitro repository and runs the local test node setup"
name: Run nitro-testnode
description: 'Checks out the nitro-testnode repository and runs the local testnode'
inputs:
no-token-bridge:
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: "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: 'release'
description: 'The nitro-testnode branch to use'
nitro-contracts-branch:
required: false
description: "The nitro-contracts branch to use"
description: 'The nitro-contracts branch to use'
token-bridge-branch:
required: false
description: "The token-bridge-contracts branch to use"
description: 'The token-bridge-contracts branch to use'
args:
required: false
default: ''
description: 'Additional args that can be supplied to the testnode script'
runs:
using: "composite"
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v4
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
Expand All @@ -57,27 +41,23 @@ runs:
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' || '' }} \
${{ inputs.args }} &
./test-node.bash --init ${{ inputs.args }} &

- name: Wait for nitro startup
- name: Wait for L2 startup
shell: bash
run: ${{ github.action_path }}/waitForNitro.sh 8547

- name: Wait for L3 startup
if: ${{ inputs.l3-node == 'true' }}
if: ${{ contains(inputs.args, '--l3node') }}
shell: bash
run: ${{ github.action_path }}/waitForNitro.sh 3347

- name: Wait for token bridge deployment
if: ${{ inputs.no-token-bridge != 'true' }}
- name: Wait for L2 token bridge deployment
if: ${{ contains(inputs.args, '--tokenbridge') }}
shell: bash
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' }}
- name: Wait for L3 token bridge deployment
if: ${{ contains(inputs.args, '--l3-token-bridge') }}
shell: bash
run: ${{ github.action_path }}/waitForTokenBridge.sh l2l3_network.json