From 3f5efbff50242fc04209d095e2f156f09d5648ae Mon Sep 17 00:00:00 2001 From: mgt Date: Fri, 29 Nov 2024 23:27:53 +0800 Subject: [PATCH] ci: setup benchmark --- .github/workflows/bench.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/bench.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml new file mode 100644 index 0000000..b6ef73d --- /dev/null +++ b/.github/workflows/bench.yml @@ -0,0 +1,35 @@ +name: Benchmark +on: + push: + branches: + - master + +permissions: + contents: write + deployments: write + +jobs: + benchmark: + name: Run Rust benchmark example + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run benchmark + run: cargo bench --output-format bencher | tee output.txt + + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: Rust Benchmark + tool: 'cargo' + output-file-path: output.txt + github-token: ${{ secrets.PAGES_RESULT_REPO_TOKEN }} + auto-push: true + # Show alert with commit comment on detecting possible performance regression + alert-threshold: '400%' + comment-on-alert: true + fail-on-alert: true + alert-comment-cc-users: '@Enter-tainer' + gh-repository: 'github.com/Enter-tainer/typstyle-bench-results'