|
| 1 | +name: Build Benchmark Genesis Asset |
| 2 | +description: Generate benchmark_genesis.tar.gz from benchmark fixtures using Hive |
| 3 | +inputs: |
| 4 | + fixtures_path: |
| 5 | + description: "Path to the benchmark fixtures tarball" |
| 6 | + required: true |
| 7 | +outputs: |
| 8 | + genesis_tarball: |
| 9 | + description: "Path to the generated benchmark_genesis.tar.gz" |
| 10 | + value: ${{ steps.create-tarball.outputs.path }} |
| 11 | +runs: |
| 12 | + using: "composite" |
| 13 | + steps: |
| 14 | + - name: Checkout Hive |
| 15 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 16 | + with: |
| 17 | + repository: ethereum/hive |
| 18 | + ref: master |
| 19 | + path: hive |
| 20 | + |
| 21 | + - name: Setup Go for Hive |
| 22 | + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 |
| 23 | + with: |
| 24 | + go-version: ">=1.24" |
| 25 | + cache-dependency-path: hive/go.sum |
| 26 | + |
| 27 | + - name: Build Hive |
| 28 | + shell: bash |
| 29 | + run: | |
| 30 | + cd hive |
| 31 | + go build . |
| 32 | +
|
| 33 | + - name: Extract benchmark fixtures |
| 34 | + shell: bash |
| 35 | + run: | |
| 36 | + echo "Extracting fixtures from ${{ inputs.fixtures_path }}" |
| 37 | + tar -xzf "${{ inputs.fixtures_path }}" |
| 38 | + echo "Fixtures extracted successfully" |
| 39 | +
|
| 40 | + - name: Start Hive in dev mode |
| 41 | + shell: bash |
| 42 | + run: | |
| 43 | + cd hive |
| 44 | + ./hive --dev \ |
| 45 | + --client besu,go-ethereum,nethermind \ |
| 46 | + --client-file ../.github/configs/hive/latest_client_releases.yaml \ |
| 47 | + --docker.output & |
| 48 | +
|
| 49 | + echo "Waiting for Hive to be ready..." |
| 50 | + for i in {1..30}; do |
| 51 | + if curl -s http://127.0.0.1:3000 > /dev/null 2>&1; then |
| 52 | + echo "Hive is ready!" |
| 53 | + exit 0 |
| 54 | + fi |
| 55 | + echo "Waiting... ($i/30)" |
| 56 | + sleep 2 |
| 57 | + done |
| 58 | + echo "Hive failed to start within timeout" |
| 59 | + exit 1 |
| 60 | +
|
| 61 | + - name: Extract genesis configs from clients |
| 62 | + shell: bash |
| 63 | + env: |
| 64 | + HIVE_SIMULATOR: http://127.0.0.1:3000 |
| 65 | + run: | |
| 66 | + echo "Running extract_config for benchmark fixtures..." |
| 67 | + uv run extract_config \ |
| 68 | + --fixture fixtures/blockchain_tests_engine_x/pre_alloc/ \ |
| 69 | + --output genesis/ \ |
| 70 | + --hive-url http://127.0.0.1:3000 |
| 71 | +
|
| 72 | + echo "Genesis configs extracted successfully" |
| 73 | + ls -la genesis/ |
| 74 | +
|
| 75 | + - name: Create benchmark_genesis.tar.gz |
| 76 | + id: create-tarball |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + tar czf benchmark_genesis.tar.gz genesis/ |
| 80 | + echo "Created benchmark_genesis.tar.gz" |
| 81 | + ls -lh benchmark_genesis.tar.gz |
| 82 | + echo "path=benchmark_genesis.tar.gz" >> "$GITHUB_OUTPUT" |
0 commit comments