Skip to content

Commit 52716b6

Browse files
authored
chore: run benchmark in CI (#18)
1 parent 59c92b5 commit 52716b6

File tree

1 file changed

+62
-41
lines changed

1 file changed

+62
-41
lines changed

.github/workflows/build.yaml

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
push:
66
branches: [ "main" ]
77
pull_request:
8-
branches: [ "main" ]
98

109
jobs:
1110
go-lint:
@@ -47,43 +46,65 @@ jobs:
4746
run: |
4847
go test -v -coverprofile=coverage.out ./...
4948
50-
# basic-benchmarks:
51-
# runs-on: ubuntu-latest
52-
# steps:
53-
# - uses: actions/checkout@v3
54-
55-
# - name: Set up Go
56-
# uses: actions/setup-go@v3
57-
# with:
58-
# go-version: 1.24
59-
60-
# - name: Install project dependencies
61-
# run: |
62-
# go mod download
63-
64-
# - name: Download geth and reth
65-
# run: |
66-
# # https://github.com/paradigmxyz/reth/releases/download/v1.3.4/reth-v1.3.4-x86_64-unknown-linux-gnu.tar.gz
67-
# # 62e5e435d1e981f97fff76f638fdf7cc4b9dbcbed66fcb10c4be6bd9d0dfd0ba /Users/meyer9/Downloads/reth-v1.3.4-x86_64-unknown-linux-gnu.tar.gz.asc
68-
# # Install from github.com/ethereum-optimism/op-geth
69-
70-
# wget https://github.com/paradigmxyz/reth/releases/download/v1.3.4/reth-v1.3.4-x86_64-unknown-linux-gnu.tar.gz
71-
# echo "62e5e435d1e981f97fff76f638fdf7cc4b9dbcbed66fcb10c4be6bd9d0dfd0ba reth-v1.3.4-x86_64-unknown-linux-gnu.tar.gz" | shasum -a 256 -c
72-
# tar -xvf reth-v1.3.4-x86_64-unknown-linux-gnu.tar.gz # contains ./reth
73-
# chmod +x ./reth
74-
75-
# git clone https://github.com/ethereum-optimism/op-geth
76-
# cd op-geth
77-
# git checkout --force 4bc345b22fbee14d3162becd197373a9565b7c6d
78-
# make geth
79-
# cp ./build/bin/geth ..
80-
# cd ..
81-
# chmod +x ./geth
82-
83-
# ls -la
84-
85-
# - name: Run Basic Benchmarks
86-
# id: unit
87-
# run: |
88-
# mkdir ./data-dir
89-
# go run benchmark/cmd/main.go --log.level debug run --config ./configs/basic.yml --root-dir ./data-dir --reth-bin ./reth --geth-bin ./geth
49+
basic-benchmarks:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v3
53+
54+
- name: Set up Go
55+
uses: actions/setup-go@v3
56+
with:
57+
go-version: 1.24
58+
59+
- name: Set up Rust
60+
uses: actions-rust-lang/setup-rust-toolchain@9399c7bb15d4c7d47b27263d024f0a4978346ba4 # v1.11.0
61+
62+
- name: Install project dependencies
63+
run: |
64+
go mod download
65+
66+
- name: Cache binaries
67+
uses: actions/cache@v3
68+
id: cache-bin
69+
with:
70+
path: ${{ runner.temp }}/bin
71+
key: ${{ runner.os }}-binaries
72+
73+
- name: Download geth and reth
74+
if: steps.cache-bin.outputs.cache-hit != 'true'
75+
run: |
76+
mkdir -p ${{ runner.temp }}/bin
77+
78+
git clone https://github.com/paradigmxyz/reth
79+
git -C reth checkout --force fad870e3508adcc150faa4554111368e0e16f43b
80+
81+
pushd reth
82+
cargo build --features asm-keccak --profile release --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml
83+
cp ./target/release/op-reth ${{ runner.temp }}/bin/reth
84+
popd
85+
chmod +x ${{ runner.temp }}/bin/reth
86+
87+
git clone https://github.com/ethereum-optimism/op-geth
88+
git -C op-geth checkout --force 4bc345b22fbee14d3162becd197373a9565b7c6d
89+
90+
pushd op-geth
91+
make geth
92+
cp ./build/bin/geth ${{ runner.temp }}/bin/geth
93+
chmod +x ${{ runner.temp }}/bin/geth
94+
popd
95+
96+
echo "binaries compiled:"
97+
ls -la ${{ runner.temp }}/bin
98+
99+
- name: Run Basic Benchmarks
100+
id: unit
101+
run: |
102+
mkdir ${{ runner.temp }}/data-dir
103+
mkdir ${{ runner.temp }}/output
104+
go run benchmark/cmd/main.go \
105+
--log.level debug \
106+
run \
107+
--config ./configs/basic-reth.yml \
108+
--root-dir ${{ runner.temp }}/data-dir \
109+
--reth-bin ${{ runner.temp }}/bin/reth \
110+
--geth-bin ${{ runner.temp }}/bin/geth

0 commit comments

Comments
 (0)