mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
68 lines
1.7 KiB
YAML
68 lines
1.7 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
env:
|
|
RUSTFLAGS: -D warnings
|
|
CARGO_TERM_COLOR: always
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
name: bench
|
|
jobs:
|
|
iai:
|
|
# Pin to `20.04` instead of `ubuntu-latest`, until ubuntu-latest migration is complete
|
|
# See also <https://github.com/foundry-rs/foundry/issues/3827>
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Install Valgrind
|
|
run: |
|
|
sudo apt install valgrind
|
|
|
|
- name: Checkout PR sources
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: main
|
|
|
|
- uses: Swatinem/rust-cache@v1
|
|
with:
|
|
cache-on-failure: true
|
|
|
|
- name: Generate test vectors
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: run
|
|
args: --bin reth -- test-vectors tables
|
|
|
|
- name: Set main baseline
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: bench
|
|
args: --package reth-db --bench iai
|
|
|
|
- name: Checkout main sources
|
|
uses: actions/checkout@v3
|
|
with:
|
|
clean: false
|
|
|
|
- name: Compare PR benchmark
|
|
shell: 'script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available
|
|
run: |
|
|
./.github/scripts/compare_iai.sh
|
|
|
|
# Checks that benchmarks not run in CI compile
|
|
bench-check:
|
|
name: check
|
|
runs-on: ubuntu-latest
|
|
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 bench --all --all-features --all-targets --no-run
|