From 316efe4669864b801abdc6f97564b6244967f78c Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 28 Nov 2024 12:05:09 +0100 Subject: [PATCH 1/3] ci: simplify e2e tests --- .github/workflows/test-e2e.yml | 56 +++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 9451612aa..031ea06ea 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -7,34 +7,43 @@ on: jobs: + build-cdk-image: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.22.x + + - name: Build cdk docker image + run: make build-docker + + - name: Save cdk image to archive + run: docker save --output /tmp/cdk.tar cdk + + - name: Upload archive + uses: actions/upload-artifact@v4 + with: + name: cdk + path: /tmp/cdk.tar + test-e2e: + runs-on: ubuntu-latest + timeout-minutes: 30 strategy: fail-fast: false matrix: - go-version: [ 1.22.x ] - goarch: [ "amd64" ] e2e-group: - "fork9-validium" - "fork11-rollup" - "fork12-validium" - "fork12-rollup" - "fork12-pessimistic" - runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - env: - GOARCH: ${{ matrix.goarch }} - - - name: Build Docker - run: make build-docker + - uses: actions/checkout@v4 - - name: Checkout kurtosis-cdk + - name: Checkout kurtosis-cdk repository uses: actions/checkout@v4 with: repository: 0xPolygon/kurtosis-cdk @@ -54,10 +63,21 @@ jobs: sudo chmod +x /usr/local/bin/polycli /usr/local/bin/polycli version - - name: Setup Bats and bats libs + - name: Setup bats uses: bats-core/bats-action@2.0.0 + + - name: Download cdk archive + uses: actions/download-artifact@v4 + with: + name: cdk + path: /tmp + + - name: Load cdk image + run: | + docker load --input /tmp/cdk.tar + docker image ls -a - - name: Test + - name: Run e2e tests run: make test-e2e-${{ matrix.e2e-group }} working-directory: test env: From f00e7be108c9102fe7071d182ae9e4296bb25017 Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 28 Nov 2024 12:06:32 +0100 Subject: [PATCH 2/3] chore: add job dependency --- .github/workflows/test-e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 031ea06ea..4fdfbb438 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -31,6 +31,7 @@ jobs: test-e2e: runs-on: ubuntu-latest timeout-minutes: 30 + needs: build-cdk-image strategy: fail-fast: false matrix: From 9593a8adef046603b387f04784ffe900835204da Mon Sep 17 00:00:00 2001 From: leovct Date: Thu, 28 Nov 2024 13:49:38 +0100 Subject: [PATCH 3/3] ci: bump to kurtosis-cdk latest version --- .github/workflows/test-e2e.yml | 2 +- .github/workflows/test-resequence.yml | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 4fdfbb438..1ddc63c98 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -49,7 +49,7 @@ jobs: with: repository: 0xPolygon/kurtosis-cdk path: kurtosis-cdk - ref: v0.2.22 + ref: v0.2.23 - name: Install Kurtosis CDK tools uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk diff --git a/.github/workflows/test-resequence.yml b/.github/workflows/test-resequence.yml index d280c5f16..d9750960d 100644 --- a/.github/workflows/test-resequence.yml +++ b/.github/workflows/test-resequence.yml @@ -5,7 +5,6 @@ on: # Disable test for the moment as it takes too long - "test_disabled" - concurrency: group: ${{ github.ref }} cancel-in-progress: true @@ -35,7 +34,7 @@ jobs: with: repository: 0xPolygon/kurtosis-cdk path: kurtosis-cdk - ref: v0.2.22 + ref: v0.2.23 - name: Install Kurtosis CDK tools uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk @@ -43,9 +42,9 @@ jobs: - name: Install polycli run: | POLYCLI_VERSION="${{ vars.POLYCLI_VERSION }}" - tmp_dir=$(mktemp -d) - curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir" - mv "$tmp_dir"/* /usr/local/bin/polycli + tmp_dir=$(mktemp -d) + curl -L "https://github.com/0xPolygon/polygon-cli/releases/download/${POLYCLI_VERSION}/polycli_${POLYCLI_VERSION}_linux_amd64.tar.gz" | tar -xz -C "$tmp_dir" + mv "$tmp_dir"/* /usr/local/bin/polycli rm -rf "$tmp_dir" sudo chmod +x /usr/local/bin/polycli /usr/local/bin/polycli version @@ -68,7 +67,6 @@ jobs: /usr/local/bin/yq -i '.args.zkevm_prover_image = "hermeznetwork/zkevm-prover:v8.0.0-RC5-fork.12"' params.yml /usr/local/bin/yq -i '.args.cdk_erigon_node_image = "jerrycgh/cdk-erigon:d5d04906f723f3f1d8c43c9e6baf3e18c27ff348"' params.yml - - name: Deploy Kurtosis CDK package working-directory: ./kurtosis-cdk run: kurtosis run --enclave cdk-v1 --args-file params.yml --image-download always . @@ -80,7 +78,7 @@ jobs: - name: Dump enclave logs if: failure() run: kurtosis dump ./dump - + - name: Generate archive name if: failure() run: |