-
Notifications
You must be signed in to change notification settings - Fork 508
47 lines (39 loc) · 1.52 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# act -W .github/workflows/benchmark.yml --container-architecture linux/amd64 -j benchmark -P ubuntu-latest=catthehacker/ubuntu:act-latest
name: Rust Benchmark
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
benchmark:
name: Run Rust benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libavformat-dev libavfilter-dev libavdevice-dev ffmpeg libasound2-dev
- name: Run benchmarks
run: |
cargo bench --bench pcm_decode_benchmark -- --output-format bencher | tee output.txt
echo "Benchmark output:"
cat 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: false # TODO: https://github.com/benchmark-action/github-action-benchmark/tree/master?tab=readme-ov-file#charts-on-github-pages-1
# 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: "@louis030195"
- name: Upload benchmark results
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: output.txt