diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml new file mode 100644 index 00000000..9f4b74f6 --- /dev/null +++ b/.github/workflows/smoke-test.yml @@ -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 diff --git a/smoke-test.bash b/smoke-test.bash new file mode 100755 index 00000000..5411af2c --- /dev/null +++ b/smoke-test.bash @@ -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"