From 94d725e0e38f361b8c6d91e578f377f5594ad803 Mon Sep 17 00:00:00 2001 From: Martin Paulucci Date: Wed, 27 Nov 2024 21:00:40 +0100 Subject: [PATCH] ci(l1): add integration tests workflow with hive and assertoor. (#1315) **Motivation** This is the only way to make it work, using `workflow_run` sucks. **Description** - Merged assertoor and hive tests into the same workflow so that they can reuse the `docker_build` job - Also fixed an issue with assertoor and kurtosis when having prism as part of the network --------- Co-authored-by: Rodrigo Oliveri --- .github/workflows/asertoor.yaml | 40 ------------ .github/workflows/docker_build.yaml | 39 ----------- .github/workflows/docker_publish.yaml | 2 +- .../workflows/{hive.yaml => integration.yaml} | 65 ++++++++++++++++--- test_data/network_params.yaml | 2 +- 5 files changed, 59 insertions(+), 89 deletions(-) delete mode 100644 .github/workflows/asertoor.yaml delete mode 100644 .github/workflows/docker_build.yaml rename .github/workflows/{hive.yaml => integration.yaml} (71%) diff --git a/.github/workflows/asertoor.yaml b/.github/workflows/asertoor.yaml deleted file mode 100644 index 5ae72a401d..0000000000 --- a/.github/workflows/asertoor.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Assertoor -on: - workflow_run: - workflows: [Docker build] - types: [completed] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - RUST_VERSION: 1.80.1 - -jobs: - run-assertoor: - name: Stability Check - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - steps: - - uses: actions/checkout@v4 - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: ethrex_image - path: /tmp - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - - name: Load image - run: | - docker load --input /tmp/ethrex_image.tar - - - name: Setup kurtosis testnet and run assertoor tests - uses: ethpandaops/kurtosis-assertoor-github-action@v1 - with: - kurtosis_version: "1.4.2" - ethereum_package_url: "github.com/lambdaclass/ethereum-package" - ethereum_package_branch: "ethrex-integration" - ethereum_package_args: "./test_data/network_params.yaml" diff --git a/.github/workflows/docker_build.yaml b/.github/workflows/docker_build.yaml deleted file mode 100644 index 666028278a..0000000000 --- a/.github/workflows/docker_build.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: Docker build - -# This workflow is later used in assertoor and hive workflows -on: - push: - branches: ["main"] - merge_group: - pull_request: - branches: ["**"] - # paths-ignore: - # - "README.md" - # - "LICENSE" - # - "**/README.md" - # - "**/docs/**" - -jobs: - docker_build: - name: Docker Build image - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build Docker image - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - load: true - tags: ethrex - outputs: type=docker,dest=/tmp/ethrex_image.tar - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: ethrex_image - path: /tmp/ethrex_image.tar diff --git a/.github/workflows/docker_publish.yaml b/.github/workflows/docker_publish.yaml index 3427bc0bac..48837f4352 100644 --- a/.github/workflows/docker_publish.yaml +++ b/.github/workflows/docker_publish.yaml @@ -51,6 +51,6 @@ jobs: - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true diff --git a/.github/workflows/hive.yaml b/.github/workflows/integration.yaml similarity index 71% rename from .github/workflows/hive.yaml rename to .github/workflows/integration.yaml index f7dfd6db73..398a0898e1 100644 --- a/.github/workflows/hive.yaml +++ b/.github/workflows/integration.yaml @@ -1,8 +1,10 @@ -name: Hive +name: Integration Test on: - workflow_run: - workflows: [Docker build] - types: [completed] + push: + branches: ["main"] + merge_group: + pull_request: + branches: ["**"] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -12,10 +14,59 @@ env: RUST_VERSION: 1.80.1 jobs: + docker_build: + name: Docker Build image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + load: true + tags: ethrex + outputs: type=docker,dest=/tmp/ethrex_image.tar + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ethrex_image + path: /tmp/ethrex_image.tar + + run-assertoor: + name: Assertoor - Stability Check + runs-on: ubuntu-latest + needs: [docker_build] + steps: + - uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: ethrex_image + path: /tmp + + - name: Load image + run: | + docker load --input /tmp/ethrex_image.tar + + - name: Setup kurtosis testnet and run assertoor tests + uses: ethpandaops/kurtosis-assertoor-github-action@v1 + with: + kurtosis_version: "1.4.2" + ethereum_package_url: "github.com/lambdaclass/ethereum-package" + ethereum_package_branch: "ethrex-integration" + ethereum_package_args: "./test_data/network_params.yaml" + run-hive: - name: ${{ matrix.name }} + name: Hive - ${{ matrix.name }} runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} + needs: [docker_build] strategy: matrix: include: @@ -46,8 +97,6 @@ jobs: with: name: ethrex_image path: /tmp - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - name: Load image run: | diff --git a/test_data/network_params.yaml b/test_data/network_params.yaml index 2015947155..c452529dbe 100644 --- a/test_data/network_params.yaml +++ b/test_data/network_params.yaml @@ -6,7 +6,7 @@ participants: cl_type: lighthouse validator_count: 32 - el_type: geth - cl_type: prysm + cl_type: lighthouse validator_count: 32 additional_services: