Skip to content

Commit

Permalink
fix(ci): move hive setup to its own job so we only do it once (#1541)
Browse files Browse the repository at this point in the history
**Motivation**
I ran into errors due to the frequency of docker pulls performed when
adding more elements to the `run-hive` matrix strategy. I think we can
solve it by only setting up hive once and then passing on the executable
to the different hive test jobs.
<!-- Why does this pull request exist? What are its goals? -->

**Description**
* Create a `setup-hive` job that creates the `hive` executable
* Retrieve the `hive` executable instead of creating it for each
parallel run in `run-hive`
<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number
  • Loading branch information
fmoletta authored Dec 19, 2024
1 parent 3ad1b8a commit 45eeb94
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/ci_l1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ jobs:
name: ethrex_image
path: /tmp/ethrex_image.tar

setup-hive:
name: "Setup Hive"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Hive
run: make setup-hive
- name: Upload hive artifacts
uses: actions/upload-artifact@v4
with:
name: hive
path: hive


run-assertoor:
name: Assertoor - ${{ matrix.name }}
runs-on: ubuntu-latest
Expand All @@ -119,7 +133,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Download artifacts
- name: Download etherex image artifact
uses: actions/download-artifact@v4
with:
name: ethrex_image
Expand All @@ -141,7 +155,7 @@ jobs:
run-hive:
name: Hive - ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [docker_build]
needs: [docker_build, setup-hive]
if: ${{ github.event_name != 'merge_group' }}
strategy:
matrix:
Expand All @@ -168,32 +182,26 @@ jobs:
simulation: ethereum/engine
test_pattern: "engine-api/RPC|Re-Org Back to Canonical Chain From Syncing Chain|Re-org to Previously Validated Sidechain Payload|Re-Org Back into Canonical Chain, Depth=5|Safe Re-Org|Transaction Re-Org|Inconsistent|Suggested Fee|PrevRandao|Fork ID|Unknown|Invalid PayloadAttributes|Bad Hash|Unique Payload ID|Re-Execute Payload|In-Order|Multiple New Payloads|Valid NewPayload|NewPayload with|Invalid NewPayload|Payload Build|Invalid NewPayload, Transaction|ParentHash equals|Build Payload|Invalid Missing Ancestor ReOrg"
steps:
- name: Download artifacts
- name: Checkout sources
uses: actions/checkout@v4

- name: Download ethrex image artifact
uses: actions/download-artifact@v4
with:
name: ethrex_image
path: /tmp

- name: Download hive artifacts
uses: actions/download-artifact@v4
with:
name: hive

- name: Load image
run: |
docker load --input /tmp/ethrex_image.tar
- name: Checkout sources
uses: actions/checkout@v4

- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Setup Go
uses: actions/setup-go@v5

- name: Setup Hive
run: make setup-hive

- name: Run Hive Simulation
run: cd hive && ./hive --client ethrex --sim ${{ matrix.simulation }} --sim.limit "${{ matrix.test_pattern }}" --sim.parallelism 4
run: chmod +x hive && ./hive --client ethrex --sim ${{ matrix.simulation }} --sim.limit "${{ matrix.test_pattern }}" --sim.parallelism 4

# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
all-tests:
Expand Down

0 comments on commit 45eeb94

Please sign in to comment.