Skip to content

chore: run benchmark in CI #40

chore: run benchmark in CI

chore: run benchmark in CI #40

Workflow file for this run

# Go test workflow
name: test
on:
push:
branches: [ "main" ]
pull_request:
jobs:
go-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.24
- name: Install project dependencies
run: |
go mod download
- name: Lint Go
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: v2.0
go-test:
outputs:
COVERAGE: ${{ steps.unit.outputs.coverage }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.24
- name: Install project dependencies
run: |
go mod download
- name: Run Unit Tests
id: unit
run: |
go test -v -coverprofile=coverage.out ./...
basic-benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.24
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
- name: Install project dependencies
run: |
go mod download
- name: Cache binaries
uses: actions/cache@v3
id: cache-bin
with:
path: ${{ runner.temp }}/bin
key: ${{ runner.os }}-binaries
- name: Download geth and reth
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir -p ${{ runner.temp }}/bin
git clone https://github.com/paradigmxyz/reth
git -C reth checkout --force fad870e3508adcc150faa4554111368e0e16f43b
pushd reth
cargo build --features asm-keccak --profile release --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml
cp ./target/release/op-reth ${{ runner.temp }}/bin/reth
popd
chmod +x ${{ runner.temp }}/bin/reth
git clone https://github.com/ethereum-optimism/op-geth
git -C op-geth checkout --force 4bc345b22fbee14d3162becd197373a9565b7c6d
pushd op-geth
make geth
cp ./build/bin/geth ${{ runner.temp }}/bin/geth
chmod +x ${{ runner.temp }}/bin/geth
popd
echo "binaries compiled:"
ls -la ${{ runner.temp }}/bin
- name: Run Basic Benchmarks
id: unit
run: |
mkdir ${{ runner.temp }}/data-dir
mkdir ${{ runner.temp }}/output
go run benchmark/cmd/main.go \
--log.level debug \
run \
--config ./configs/basic-reth.yml \
--root-dir ${{ runner.temp }}/data-dir \
--reth-bin ${{ runner.temp }}/bin/reth \
--geth-bin ${{ runner.temp }}/bin/geth