-
Notifications
You must be signed in to change notification settings - Fork 79
66 lines (65 loc) · 1.82 KB
/
bench.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Rust Bench
on:
pull_request:
jobs:
runBenchMark:
name: run benchmark
runs-on: ubuntu-latest
env:
RUSTC_VERSION: 1.79.0
steps:
- uses: actions/checkout@v4
- name: Checkout base branch
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
path: main/
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUSTC_VERSION }}
override: true
target: wasm32-unknown-unknown
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
- name: Cache cargo build
uses: actions/cache@v4
with:
path: |
~/.cargo
target
rust/bench/target
key: ${{ runner.os }}-bench-0.1.4-${{ hashFiles('**/Cargo.lock') }}
- name: Install canbench
run: cargo install canbench
- name: Run perf for base branch
run: |
pushd main/rust/bench
canbench --persist
popd
cp main/rust/bench/canbench_results.yml rust/bench/
- name: Run perf for PR beanch
run: |
pushd rust/bench
canbench --less-verbose --persist > /tmp/perf.txt
python diff.py canbench_results.yml ../../main/rust/bench/canbench_results.yml > /tmp/table.md
{
cat /tmp/table.md
echo "<details><summary>Click to see raw report</summary>"
echo
echo "\`\`\`"
cat /tmp/perf.txt
echo "\`\`\`"
echo "</details>"
} > /tmp/message.txt
- name: Post comment
uses: thollander/actions-comment-pull-request@v2
with:
filePath: /tmp/message.txt
comment_tag: canbench