Skip to content

Commit 85d50ca

Browse files
committed
Add GitHub Actions workflow for benchmark reporting and release packaging
- Introduced a new step in the CI workflow to run benchmarks and package the results for release. - Added functionality to publish benchmark reports to GitHub Pages, enhancing visibility of performance metrics. - Updated the README in the benches directory to include a release summary table for tracking benchmark results across versions.
1 parent 3d76778 commit 85d50ca

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,35 @@ jobs:
1919
name: GitHub Release
2020
runs-on: ubuntu-latest
2121
steps:
22+
- uses: actions/checkout@v4
23+
- uses: dtolnay/rust-toolchain@stable
24+
- uses: Swatinem/rust-cache@v2
25+
- name: Run benchmarks
26+
run: cargo bench --no-fail-fast
27+
- name: Package benchmark results
28+
run: tar -czf criterion-results.tar.gz target/criterion
29+
- name: Prepare gh-pages publish directory
30+
run: |
31+
mkdir -p target/gh-pages/benchmarks/${{ github.ref_name }}
32+
mkdir -p target/gh-pages/benchmarks/latest
33+
cp -R target/criterion/. target/gh-pages/benchmarks/${{ github.ref_name }}/
34+
cp -R target/criterion/. target/gh-pages/benchmarks/latest/
35+
- name: Publish benchmark report to gh-pages
36+
uses: peaceiris/actions-gh-pages@v4
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: target/gh-pages
2240
- name: Create release for tag push
2341
if: github.event_name == 'push'
2442
uses: softprops/action-gh-release@v2
2543
with:
2644
generate_release_notes: true
45+
files: criterion-results.tar.gz
2746

2847
- name: Create release for manual dispatch
2948
if: github.event_name == 'workflow_dispatch'
3049
uses: softprops/action-gh-release@v2
3150
with:
3251
tag_name: ${{ inputs.tag }}
3352
generate_release_notes: true
53+
files: criterion-results.tar.gz

benches/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ Notes:
3535
- Values above are from `cargo bench --bench lru`, `--bench lru_k`, and
3636
`--bench lfu` run in the same session.
3737
- Throughput is derived from `Throughput::Elements(...)` in the benchmarks.
38+
39+
## Release summary (tagged)
40+
41+
Use this table to track benchmarks captured for releases. Update after tagging
42+
and running the release benchmarks.
43+
44+
| Release | Date | Environment | Micro-ops (ns/op) | Policy throughput (Melem/s) | Workload throughput (Melem/s) | Report link |
45+
| --- | --- | --- | --- | --- | --- | --- |
46+
| v0.1.0 | 2025-01-12 | TBD | TBD | TBD | TBD | TBD |

0 commit comments

Comments
 (0)