surrealpatch/.github/workflows/bench.yml

53 lines
1.4 KiB
YAML
Raw Normal View History

name: Benchmark
on:
push:
pull_request:
defaults:
run:
shell: bash
jobs:
bench:
name: Bench library
2023-06-09 15:19:26 +00:00
runs-on: ubuntu-20.04
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get -qq -y update
sudo apt-get -qq -y install protobuf-compiler libprotobuf-dev
cargo install --quiet critcmp
- name: Checkout baseline
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Benchmark baseline
run: cargo bench --quiet --package surrealdb --no-default-features --features kv-mem,scripting,http -- --save-baseline baseline
- name: Extract baseline
run: cp -r target/criterion /tmp/criterion
- name: Checkout changes
uses: actions/checkout@v3
- name: Replace baseline
run: mkdir target && cp -r /tmp/criterion target/criterion
- name: Benchmark changes
run: cargo bench --quiet --package surrealdb --no-default-features --features kv-mem,scripting,http -- --save-baseline changes
- name: Compare results
run: critcmp baseline changes | tee benchmark_results
- name: Save results as artifact
uses: actions/upload-artifact@v1
with:
name: Benchmark Results
path: benchmark_results