2021-12-31 17:58:39 +00:00
|
|
|
name: Benchmark
|
|
|
|
on:
|
|
|
|
push:
|
2022-01-02 19:46:32 +00:00
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'benches/**'
|
|
|
|
- 'ogg_pager/**'
|
2021-12-31 17:58:39 +00:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
benchmark:
|
|
|
|
name: Benchmark
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Run benchmark
|
2021-12-31 18:36:42 +00:00
|
|
|
run: cargo bench --all-features -- --output-format bencher | tee output.txt
|
2021-12-31 17:58:39 +00:00
|
|
|
|
|
|
|
- name: Store benchmark result
|
|
|
|
uses: benchmark-action/github-action-benchmark@v1
|
|
|
|
with:
|
|
|
|
# What benchmark tool the output.txt came from
|
|
|
|
tool: 'cargo'
|
|
|
|
# Where the output from the benchmark tool is stored
|
|
|
|
output-file-path: output.txt
|
2021-12-31 18:09:19 +00:00
|
|
|
# Show alert with commit comment on detecting possible performance regression
|
|
|
|
alert-threshold: '200%'
|
2021-12-31 17:58:39 +00:00
|
|
|
# Workflow will fail when an alert happens
|
|
|
|
fail-on-alert: true
|
|
|
|
# GitHub API token to make a commit comment
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Enable alert commit comment
|
|
|
|
comment-on-alert: true
|
2021-12-31 18:09:19 +00:00
|
|
|
auto-push: true
|