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: runs-on: ubuntu-latest 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