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

[NIT-2610] CI with more complex topology #66

Merged
merged 2 commits into from
Jun 24, 2024
Merged
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
29 changes: 22 additions & 7 deletions .github/workflows/testnode.bash
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
#!/bin/bash
# The script starts up the test node and waits until the timeout (10min) or
# The script starts up the test node and waits until the timeout (10min) or
# until send-l2 succeeds.

# Start the test node and get PID, to terminate it once send-l2 is done.
cd ${GITHUB_WORKSPACE}

# TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var
./test-node.bash --init-force --detach
./test-node.bash --init-force --l3node --no-simple --detach

START=$(date +%s)
SUCCEDED=0
L2_TRANSACTION_SUCCEEDED=false
L3_TRANSACTION_SUCCEEDED=false
SUCCEEDED=false

while true; do
if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then
echo "Sending l2 transaction succeeded"
SUCCEDED=1
if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then
if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then
echo "Sending l2 transaction succeeded"
L2_TRANSACTION_SUCCEEDED=true
fi
fi

if [ "$L3_TRANSACTION_SUCCEEDED" = false ]; then
if ${GITHUB_WORKSPACE}/test-node.bash script send-l3 --ethamount 100 --to user_l3user --wait; then
echo "Sending l3 transaction succeeded"
L3_TRANSACTION_SUCCEEDED=true
fi
fi

if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$L3_TRANSACTION_SUCCEEDED" = true ]; then
SUCCEEDED=true
break
fi

Expand All @@ -31,7 +46,7 @@ done

docker-compose stop

if [ "$SUCCEDED" -eq 0 ]; then
if [ "$SUCCEEDED" = false ]; then
docker-compose logs
exit 1
fi
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
blockscout:
depends_on:
Expand Down
Loading