Skip to content

Commit

Permalink
feat: use detach
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Oct 28, 2024
1 parent 08e07da commit 50be2e6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/run-nitro-test-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
with:
no-token-bridge: true

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

run-with-simple:
name: "Run in simple mode"
Expand Down
2 changes: 1 addition & 1 deletion run-nitro-test-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ runs:
${{ 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 }} >${{ runner.temp }}/test-node.log 2>&1 &
${{ inputs.args }} --detach
- name: Wait for nitro startup
shell: bash
Expand Down
8 changes: 2 additions & 6 deletions run-nitro-test-node/waitForNitro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ PORT=${1:-8547}
# timeout after around 10 minutes
for i in {1..60}
do
# dirty way to print and truncate the log file
# some lines can be missing due to race condition
cat $RUNNER_TEMP/test-node.log
: > $RUNNER_TEMP/test-node.log
curl --silent -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' "http://localhost:$PORT"
if [ "$?" -eq "0" ]; then
echo "nitro ready at port $PORT"
exit 0
else
# echo "nitro not ready yet at port $PORT"
echo "nitro not ready yet at port $PORT"
sleep 10
fi
done
cat $RUNNER_TEMP/test-node.log
echo "exiting: printing docker logs"
docker compose -f ./nitro-testnode/docker-compose.yaml logs
exit 1
2 changes: 1 addition & 1 deletion run-nitro-test-node/waitForTokenBridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ do
sleep 10
fi
done
cat $RUNNER_TEMP/test-node.log
echo "exiting: printing docker logs"
docker compose -f ./nitro-testnode/docker-compose.yaml logs tokenbridge
exit 1

0 comments on commit 50be2e6

Please sign in to comment.