From 1ee92f4c0f5ccf5316cfd1b453d1f82b9ae0952d Mon Sep 17 00:00:00 2001 From: Kermit Date: Mon, 16 Sep 2024 22:05:19 +0800 Subject: [PATCH] add benchmark ci --- .github/workflows/bench.yaml | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/bench.yaml diff --git a/.github/workflows/bench.yaml b/.github/workflows/bench.yaml new file mode 100644 index 0000000..2524827 --- /dev/null +++ b/.github/workflows/bench.yaml @@ -0,0 +1,45 @@ +# Do not run this workflow on pull request since this workflow has permission to modify contents. +on: + push: + branches: + - master + +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: + bench: + name: Build and Bench + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + name: Checkout 🛎️ + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-bench + - uses: actions-rs/toolchain@v1 + name: Setup Cargo Toolchain 🛎️ + with: + toolchain: nightly + default: true + - name: Benchmark 🚀 + run: cargo +nightly bench --all-features --workspace --bench benches_against_rocksdb -- --output-format bencher | tee output.txt + - uses: benchmark-action/github-action-benchmark@v1 + name: Store benchmark result + with: + name: Benchmark with RocksDB + 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