|
| 1 | +name: Hive Consume Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'forks/**' |
| 7 | + pull_request: |
| 8 | + # TODO: After initial testing, uncomment these paths to only run on relevant changes: |
| 9 | + # paths: |
| 10 | + # - '.github/workflows/hive-consume.yaml' |
| 11 | + # - 'packages/tests/src/pytest_plugins/consume/**' |
| 12 | + # - 'packages/tests/src/pytest_plugins/pytest_hive/**' |
| 13 | + # - 'packages/testing/src/execution_testing/cli/pytest_commands/plugins/consume/**' |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: hive-consume-${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + test-hive: |
| 22 | + name: ${{ matrix.name }} |
| 23 | + runs-on: ubuntu-latest |
| 24 | + strategy: |
| 25 | + fail-fast: true |
| 26 | + matrix: |
| 27 | + include: |
| 28 | + - name: consume-engine |
| 29 | + mode: simulator |
| 30 | + simulator: ethereum/eels/consume-engine |
| 31 | + - name: consume-rlp |
| 32 | + mode: simulator |
| 33 | + simulator: ethereum/eels/consume-rlp |
| 34 | + - name: consume-sync |
| 35 | + mode: simulator |
| 36 | + simulator: ethereum/eels/consume-sync |
| 37 | + - name: dev-mode |
| 38 | + mode: dev |
| 39 | + consume_command: engine |
| 40 | + steps: |
| 41 | + - name: Checkout execution-specs |
| 42 | + if: matrix.mode == 'dev' |
| 43 | + uses: actions/checkout@v5 |
| 44 | + with: |
| 45 | + path: execution-specs |
| 46 | + |
| 47 | + - name: Checkout Hive |
| 48 | + uses: actions/checkout@v5 |
| 49 | + with: |
| 50 | + repository: ethereum/hive |
| 51 | + ref: master |
| 52 | + path: hive |
| 53 | + |
| 54 | + - name: Setup go env and cache |
| 55 | + uses: actions/setup-go@v5 |
| 56 | + with: |
| 57 | + go-version: '>=1.24' |
| 58 | + cache-dependency-path: hive/go.sum |
| 59 | + |
| 60 | + - name: Setup Python |
| 61 | + if: matrix.mode == 'dev' |
| 62 | + uses: actions/setup-python@v5 |
| 63 | + with: |
| 64 | + python-version: '3.12' |
| 65 | + |
| 66 | + - name: Install uv |
| 67 | + if: matrix.mode == 'dev' |
| 68 | + run: | |
| 69 | + curl -LsSf https://astral.sh/uv/install.sh | sh |
| 70 | + echo "$HOME/.cargo/bin" >> $GITHUB_PATH |
| 71 | +
|
| 72 | + - name: Pre-pull geth docker image |
| 73 | + run: docker pull docker.ethquokkaops.io/dh/ethpandaops/geth:master |
| 74 | + |
| 75 | + - name: Create clients.yaml |
| 76 | + run: | |
| 77 | + cat > hive/clients.yaml << 'EOF' |
| 78 | + - client: go-ethereum |
| 79 | + nametag: default |
| 80 | + build_args: |
| 81 | + baseimage: docker.ethquokkaops.io/dh/ethpandaops/geth |
| 82 | + tag: master |
| 83 | + EOF |
| 84 | +
|
| 85 | + - name: Build hive |
| 86 | + run: | |
| 87 | + cd hive |
| 88 | + go build . |
| 89 | +
|
| 90 | + - name: Run simulator tests |
| 91 | + if: matrix.mode == 'simulator' |
| 92 | + run: | |
| 93 | + cd hive |
| 94 | + ./hive --sim '${{ matrix.simulator }}' \ |
| 95 | + --sim.parallelism=1 \ |
| 96 | + --client go-ethereum \ |
| 97 | + --client-file clients.yaml \ |
| 98 | + --sim.buildarg fixtures=develop@latest \ |
| 99 | + --sim.limit=".*test_block_at_rlp_limit_with_logs.*Osaka.*" \ |
| 100 | + --docker.output |
| 101 | +
|
| 102 | + - name: Start Hive in dev mode |
| 103 | + if: matrix.mode == 'dev' |
| 104 | + run: | |
| 105 | + cd hive |
| 106 | + ./hive --dev --client go-ethereum --client-file clients.yaml --docker.output & |
| 107 | + echo "Waiting for Hive to be ready..." |
| 108 | + for i in {1..30}; do |
| 109 | + if curl -s http://127.0.0.1:3000 > /dev/null 2>&1; then |
| 110 | + echo "Hive is ready!" |
| 111 | + break |
| 112 | + fi |
| 113 | + echo "Waiting... ($i/30)" |
| 114 | + sleep 2 |
| 115 | + done |
| 116 | +
|
| 117 | + - name: Run consume in dev mode |
| 118 | + if: matrix.mode == 'dev' |
| 119 | + working-directory: execution-specs |
| 120 | + env: |
| 121 | + HIVE_SIMULATOR: http://127.0.0.1:3000 |
| 122 | + run: | |
| 123 | + uv sync --all-extras |
| 124 | + uv run consume ${{ matrix.consume_command }} --input develop@latest -k "Osaka and test_block_at_rlp_limit_with_logs" |
0 commit comments