forked from OffchainLabs/nitro-testnode
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Smoke test for nitro testnode * check latest confirmation --------- Co-authored-by: sveitser <[email protected]>
- Loading branch information
Showing
2 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Smoke Test CI | ||
run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }} | ||
|
||
on: | ||
workflow_dispatch: | ||
merge_group: | ||
push: | ||
schedule: | ||
# Run at the end of every day | ||
- cron: "0 0 * * *" | ||
|
||
# Cancel in-progress jobs except for integration branch | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ !contains(github.ref, 'integration/')}} | ||
|
||
|
||
jobs: | ||
smoke_test: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: network=host | ||
|
||
# Explicitly building the docker images because it's not clear how we can | ||
# use the github acion (gha) cache if we let docker compose build the images. | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: ./rollupcreator | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
# Use default branch from test-node.bash | ||
build-args: | | ||
NITRO_CONTRACTS_BRANCH=develop | ||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: ./scripts | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: ./tokenbridge | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
# Use default branch from test-node.bash | ||
build-args: | | ||
TOKEN_BRIDGE_BRANCH=v1.2.2 | ||
- name: Start Smoke Test with Latest Espresso Image | ||
run: | | ||
./smoke-test.bash | ||
timeout-minutes: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init --detach | ||
|
||
# Sending L2 transaction | ||
./test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait | ||
|
||
rollupAddress=$(docker compose run --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'") | ||
while true; do | ||
confirmed=$(cast call --rpc-url http://localhost:8545 $rollupAddress 'latestConfirmed()(uint256)') | ||
echo "Number of confirmed staking nodes: $confirmed" | ||
if [ "$confirmed" -gt 0 ]; then | ||
break | ||
else | ||
echo "Waiting for more confirmed nodes ..." | ||
fi | ||
sleep 5 | ||
done | ||
|
||
echo "Smoke test succeeded" |