This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (72 loc) · 2.18 KB
/
bench.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: bench
jobs:
iai:
runs-on:
group: Reth
# Only run benchmarks in merge groups
if: github.event_name != 'pull_request'
steps:
- name: Checkout main sources
uses: actions/checkout@v3
with:
ref: main
path: main
- name: Checkout PR sources
uses: actions/checkout@v3
with:
clean: false
path: pr
- name: Install Valgrind
run: |
sudo apt update && sudo apt install valgrind
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
main -> target
pr -> target
cache-on-failure: true
- name: Generate test vectors
run: |
cargo run --bin reth --manifest-path main/Cargo.toml -- test-vectors tables
cp -r testdata main
mv testdata pr
- name: Set main baseline
run: cargo bench --package reth-db --bench iai --features test-utils --manifest-path main/Cargo.toml
- name: Compare PR benchmark
shell: 'script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available
run: |
./pr/.github/scripts/compare_iai.sh
# Checks that benchmarks not run in CI compile
bench-check:
name: check
runs-on:
group: Reth
strategy:
matrix:
network: ["ethereum", "optimism"]
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check if benchmarks build
run: cargo check --workspace --benches --features "jemalloc-prof,${{ matrix.network }},min-error-logs,min-warn-logs,min-info-logs,min-debug-logs,min-trace-logs"
bench-success:
if: always()
name: bench success
runs-on: ubuntu-latest
steps:
# Note: This check is a dummy because we don't have any bench checks enabled.
- run: echo OK.