From 2160bbd220843f898d36e586660c01b79f317309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Vincent?= <28714795+leovct@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:38:25 +0100 Subject: [PATCH] ci: fix regression test workflow (#704) * ci: update regression tests job * fix: typo * ci: monitor verified batches --- .github/workflows/regression-tests.yml | 102 ++++++++++++++++++------- 1 file changed, 75 insertions(+), 27 deletions(-) diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 831776b2..a3f7aa2d 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -2,34 +2,82 @@ name: Regression Tests on: pull_request: - types: [opened, synchronize] # Trigger on new PR and existing with new commits - branches: - - develop - + push: + branches: [develop] + +concurrency: + group: regression-tests-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + ENCLAVE_NAME: cdk jobs: - regression_tests: + build-docker-image: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - name: Build docker image + run: make build-docker + + - name: Save docker image to archive + run: docker save --output /tmp/zkevm-bridge-service.tar zkevm-bridge-service + + - name: Upload archive + uses: actions/upload-artifact@v4 + with: + name: zkevm-bridge-service + path: /tmp/zkevm-bridge-service.tar + + deploy-cdk-stack: runs-on: ubuntu-latest + timeout-minutes: 30 + needs: build-docker-image steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - - name: Build image (with proposed code changes) locally - id: build - run: | - if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then - GITHUB_SHA_SHORT=$(jq -r .pull_request.head.sha "$GITHUB_EVENT_PATH" | cut -c 1-7) - echo $GITHUB_SHA_SHORT - echo "::set-output name=GITHUB_SHA_SHORT::$GITHUB_SHA_SHORT" - fi - - name: Run Regression Tests - uses: 0xPolygon/kurtosis-cdk@v0.1.9 - with: - zkevm_bridge_service: ${{ steps.build.outputs.GITHUB_SHA_SHORT }} - zkevm_agglayer: '0.1.4' - zkevm_bridge_ui: '0006445' - zkevm_dac: '0.0.7' - zkevm_node: '0.6.5-cdk' - kurtosis_cdk: 'v0.2.3' - kurtosis_cli: '0.89.3' - bake_time: 30 \ No newline at end of file + - uses: actions/checkout@v4 + + - name: Checkout kurtosis-cdk repository + uses: actions/checkout@v4 + with: + repository: 0xPolygon/kurtosis-cdk + path: kurtosis-cdk + ref: v0.2.24 + + - name: Install Kurtosis CDK tools + uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk + + - name: Download archive + uses: actions/download-artifact@v4 + with: + name: zkevm-bridge-service + path: /tmp + + - name: Load docker image + run: | + docker load --input /tmp/zkevm-bridge-service.tar + docker image ls -a + + - name: Deploy kurtosis enclave + working-directory: kurtosis-cdk + run: | + kurtosis run --enclave ${{ env.ENCLAVE_NAME }} . '{"args": {"zkevm_bridge_service_image": "zkevm-bridge-service:latest"}}' + + - name: Monitor verified batches + working-directory: ./kurtosis-cdk/.github/scripts + run: | + ./monitor-verified-batches.sh \ + --enclave ${{ env.ENCLAVE_NAME }} \ + --rpc-url $(kurtosis port print ${{ env.ENCLAVE_NAME }} cdk-erigon-rpc-001 rpc) + + - name: Dump enclave + if: ${{ !cancelled() }} + run: kurtosis enclave dump ${{ env.ENCLAVE_NAME }} ./dump + + - name: Upload enclave dump + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: dump_regression_tests_${{ github.run_id }} + path: ./dump