Skip to content

Commit

Permalink
feat(ci): add benchmark workflow (#845)
Browse files Browse the repository at this point in the history
This PR adds a benchmark workflow to CI. It will run TPC-H bench for
each commit on main branch and show the result in charts
([example](https://risingwavelabs.github.io/arrow-udf/dev/bench/)).

Signed-off-by: Runji Wang <wangrunji0408@163.com>
  • Loading branch information
wangrunji0408 authored Apr 16, 2024
1 parent c4252aa commit fd5fe40
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Benchmark
on:
push:
branches:
- main

env:
CARGO_TERM_COLOR: always
CACHE_KEY_SUFFIX: v20220409
PROTOC_NO_VENDOR: 1

permissions:
contents: write
deployments: write

jobs:
benchmark:
name: Run benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ env.CACHE_KEY_SUFFIX }}
- name: Run benchmark
run: cargo bench --bench tpch -- --output-format bencher | tee output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Rust Benchmark
tool: 'cargo'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@wangrunji0408,@skyzh'

0 comments on commit fd5fe40

Please sign in to comment.