Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bench: add bench action #173

Merged
merged 20 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ on:
workflow_dispatch:
inputs:
reason:
description: 'reason to trigger this build'
description: "reason to trigger this build"
required: false


permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

name: Bench

jobs:
Expand All @@ -26,11 +32,17 @@ jobs:
with:
toolchain: nightly
default: true
- uses: actions-rs/cargo@v1
name: Benchmark 🚀
- name: Benchmark 🚀
run: cargo +nightly bench --all-features --workspace -- --output-format bencher | tee output.txt
GanZiheng marked this conversation as resolved.
Show resolved Hide resolved
- uses: benchmark-action/github-action-benchmark@v1
name: Store benchmark result
with:
command: bench
args: --all-features --workspace
tool: "cargo"
output-file-path: output.txt
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true
sanitizer_bench:
name: Bench with Sanitizer
runs-on: ubuntu-latest
Expand Down Expand Up @@ -77,4 +89,4 @@ jobs:
command: bench
args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu
env:
RUSTFLAGS: "-Zsanitizer=thread"
RUSTFLAGS: "-Zsanitizer=thread"
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ incremental = false
debug-assertions = false
overflow-checks = false
rpath = false

[lib]
bench = false
GanZiheng marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ prost = "0.8"

[build-dependencies]
prost-build = { version = "0.8" }

[lib]
bench = false
3 changes: 3 additions & 0 deletions skiplist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ tikv-jemallocator = "0.4.0"
[[bench]]
name = "bench"
harness = false

[lib]
bench = false