88
99env :
1010 CARGO_TERM_COLOR : always
11+ BASELINE : base
1112
1213concurrency :
1314 group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -21,40 +22,33 @@ jobs:
2122 # Only run benchmarks in merge groups
2223 if : github.event_name != 'pull_request'
2324 steps :
24- - name : Checkout main sources
25- uses : actions/checkout@v4
26- with :
27- ref : main
28- path : main
29- - name : Checkout PR sources
30- uses : actions/checkout@v4
31- with :
32- clean : false
33- path : pr
25+ - uses : actions/checkout@v4
3426 - name : Install Valgrind
3527 run : sudo apt update && sudo apt install valgrind
3628 - uses : dtolnay/rust-toolchain@stable
3729 - uses : Swatinem/rust-cache@v2
3830 with :
39- workspaces : |
40- main -> target
41- pr -> target
4231 cache-on-failure : true
32+ - name : Install cargo-binstall
33+ uses : taiki-e/install-action@cargo-binstall
4334 - name : Install iai-callgrind-runner
4435 run : |
4536 version=$(cargo metadata --format-version=1 |\
4637 jq '.packages[] | select(.name == "iai-callgrind").version' |\
4738 tr -d '"'
4839 )
49- cargo install iai-callgrind-runner --version $version
40+ cargo binstall iai-callgrind-runner --version $version --no-confirm --no-symlinks
41+ - name : Checkout base
42+ uses : actions/checkout@v4
43+ with :
44+ ref : ${{ github.base_ref || 'main' }}
5045 - name : Generate test vectors
51- run : |
52- cargo run --bin reth --manifest-path main/Cargo.toml -- test-vectors tables
53- cp -r testdata main
54- mv testdata pr
55- - name : Set main baseline
56- run : cargo bench --package reth-db --bench iai --features test-utils --manifest-path main/Cargo.toml
57- - name : Compare PR benchmark
58- shell : ' script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available
59- run : .github/scripts/compare_iai.sh
60- working-directory : pr
46+ run : cargo run --bin reth -- test-vectors tables
47+ - name : Save baseline
48+ run : cargo bench -p reth-db --bench iai --features test-utils -- --save-baseline=$BASELINE
49+ - name : Checkout PR
50+ uses : actions/checkout@v4
51+ with :
52+ clean : false
53+ - name : Compare PR benchmarks
54+ run : cargo bench -p reth-db --bench iai --features test-utils -- --baseline=$BASELINE
0 commit comments