-
Notifications
You must be signed in to change notification settings - Fork 9
82 lines (63 loc) · 2.27 KB
/
Copy pathbenchmark.yml
File metadata and controls
82 lines (63 loc) · 2.27 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Benchmark
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
environment:
name: benchmarks
url: "https://jay3332.github.io/ril/benchmark/index.html"
steps:
- uses: actions/checkout@v4
- name: Install latest stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Install gnuplot and neofetch
run: sudo apt update && sudo apt install gnuplot neofetch
- name: Show system specs
run: neofetch --stdout
- name: Install cargo-criterion
uses: Cryptex-github/cached-cargo-install@main
with:
crate-name: cargo-criterion
- name: Install criterion-table
uses: Cryptex-github/cached-cargo-install@main
with:
crate-name: criterion-table
- name: Pull benchmarks data
run: git clone -b benchmarks https://github.com/jay3332/ril target/criterion
- name: Run benchmark
run: cargo criterion --all-features --message-format=json | criterion-table > BENCHMARKS.md
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: BENCHMARKS.md
path: BENCHMARKS.md
- name: Add output markdown to job summary
run: cat BENCHMARKS.md >> $GITHUB_STEP_SUMMARY
- name: Append benchmark webpage to job summary
run: echo "For more details, visit [https://jay3332.github.io/ril/benchmark/index.html](https://jay3332.github.io/ril/benchmark/index.html)" >> $GITHUB_STEP_SUMMARY
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/criterion/reports
keep_files: true
destination_dir: benchmark
- name: Save data
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/criterion
keep_files: true
publish_branch: benchmarks
- name: Set output URL
run: echo "env_url=https://jay3332.github.io/ril/benchmark/index.html" >> $GITHUB_OUTPUT