From 17fda7fe768a235170781d5e35bc3dcbae8e01e1 Mon Sep 17 00:00:00 2001 From: Martin Paulucci Date: Tue, 26 Nov 2024 18:34:15 +0100 Subject: [PATCH] build(core): separate docker job and only build once. (#1283) **Motivation** **Description** Closes #issue_number --- .github/workflows/asertoor.yaml | 20 +++++++------------- .github/workflows/ci.yaml | 14 -------------- .github/workflows/hive.yaml | 24 +++++++++--------------- .github/workflows/lint_pr_title.yml | 3 --- 4 files changed, 16 insertions(+), 45 deletions(-) diff --git a/.github/workflows/asertoor.yaml b/.github/workflows/asertoor.yaml index 0c249535e4..e366cae7ed 100644 --- a/.github/workflows/asertoor.yaml +++ b/.github/workflows/asertoor.yaml @@ -1,14 +1,9 @@ name: Assertoor on: - pull_request: - branches: ["**"] - paths-ignore: - - "README.md" - - "LICENSE" - - "**/README.md" - - "**/docs/**" - - "crates/vm/levm/**" - - "crates/l2/**" + merge_group: + workflow_run: + workflows: [Docker build] + types: [completed] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -18,13 +13,10 @@ env: RUST_VERSION: 1.80.1 jobs: - build: - uses: ./.github/workflows/docker_build.yaml - run-assertoor: name: Stability Check runs-on: ubuntu-latest - needs: [build] + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - uses: actions/checkout@v4 @@ -33,6 +25,8 @@ 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/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f13f4f224c..12c78bb976 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,17 +71,3 @@ jobs: - name: Run tests run: | make test - - docker_build: - name: Build Docker 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 # Important for building without pushing diff --git a/.github/workflows/hive.yaml b/.github/workflows/hive.yaml index e1774a7606..532de0f122 100644 --- a/.github/workflows/hive.yaml +++ b/.github/workflows/hive.yaml @@ -1,14 +1,9 @@ name: Hive on: - pull_request: - branches: ["**"] - paths-ignore: - - 'README.md' - - 'LICENSE' - - "**/README.md" - - "**/docs/**" - - "crates/vm/levm/**" - - "crates/l2/**" + merge_group: + workflow_run: + workflows: [Docker build] + types: [completed] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -18,13 +13,10 @@ env: RUST_VERSION: 1.80.1 jobs: - build: - uses: ./.github/workflows/docker_build.yaml - run-hive: name: ${{ matrix.name }} - needs: [build] runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} strategy: matrix: include: @@ -45,16 +37,18 @@ jobs: run_command: make run-hive-on-latest SIMULATION=devp2p TEST_PATTERN="eth/Status|GetBlockHeaders|SimultaneousRequests|SameRequestID|ZeroRequestID|GetBlockBodies|MaliciousHandshake|MaliciousStatus|Transaction" - simulation: engine name: "Engine Auth and EC tests" - run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="engine-(auth|exchange-capabilities)/" + run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="engine-(auth|exchange-capabilities)/" - simulation: engine-cancun name: "Cancun Engine tests" - run_command: make run-hive-on-latest SIMULATION=ethereum/engine HIVE_EXTRA_ARGS="--sim.parallelism 4" TEST_PATTERN="engine-cancun/Blob Transactions On Block 1|Blob Transaction Ordering, Single|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3 Modifies Payload ID on Different Beacon Root|NewPayloadV3 After Cancun|NewPayloadV3 Versioned Hashes|Incorrect BlobGasUsed|Bad Hash|ParentHash equals BlockHash|RPC:|in ForkchoiceState|Unknown|Invalid PayloadAttributes|Unique|ForkchoiceUpdated Version on Payload Request|Re-Execute Payload|In-Order Consecutive Payload|Multiple New Payloads|Valid NewPayload->|NewPayload with|Payload Build after|Build Payload with|Invalid Missing Ancestor ReOrg, StateRoot|Re-Org Back to|Re-org to Previously|Safe Re-Org to Side Chain|Transaction Re-Org, Re-Org Back In|Re-Org Back into Canonical Chain, Depth=5|Suggested Fee Recipient Test|PrevRandao Opcode|Invalid NewPayload, [^R][^e]|Fork ID Genesis=0, Cancun=0|Fork ID Genesis=0, Cancun=1|Fork ID Genesis=1, Cancun=0|Fork ID Genesis=1, Cancun=2, Shanghai=2" + run_command: make run-hive-on-latest SIMULATION=ethereum/engine HIVE_EXTRA_ARGS="--sim.parallelism 4" TEST_PATTERN="engine-cancun/Blob Transactions On Block 1|Blob Transaction Ordering, Single|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3 Modifies Payload ID on Different Beacon Root|NewPayloadV3 After Cancun|NewPayloadV3 Versioned Hashes|Incorrect BlobGasUsed|Bad Hash|ParentHash equals BlockHash|RPC:|in ForkchoiceState|Unknown|Invalid PayloadAttributes|Unique|ForkchoiceUpdated Version on Payload Request|Re-Execute Payload|In-Order Consecutive Payload|Multiple New Payloads|Valid NewPayload->|NewPayload with|Payload Build after|Build Payload with|Invalid Missing Ancestor ReOrg, StateRoot|Re-Org Back to|Re-org to Previously|Safe Re-Org to Side Chain|Transaction Re-Org, Re-Org Back In|Re-Org Back into Canonical Chain, Depth=5|Suggested Fee Recipient Test|PrevRandao Opcode|Invalid NewPayload, [^R][^e]|Fork ID Genesis=0, Cancun=0|Fork ID Genesis=0, Cancun=1|Fork ID Genesis=1, Cancun=0|Fork ID Genesis=1, Cancun=2, Shanghai=2" steps: - 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: | diff --git a/.github/workflows/lint_pr_title.yml b/.github/workflows/lint_pr_title.yml index 258d11400c..03232e78f6 100644 --- a/.github/workflows/lint_pr_title.yml +++ b/.github/workflows/lint_pr_title.yml @@ -1,7 +1,6 @@ name: Lint PR title on: - merge_group: pull_request_target: types: - opened @@ -11,8 +10,6 @@ on: jobs: main: name: Validate PR title - # Skip step for events that are not pull request targets as it currenlty fails when ran in the merge queue - if: github.event_name == 'pull_request_target' runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5