From 9ebd05f1e2f28b50cd69833228e33838a752834b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:04:23 +0000 Subject: [PATCH 1/4] Initial plan From 5701715e0c71552403736f4ee75a320c881eaeed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:10:02 +0000 Subject: [PATCH 2/4] feat: add automated PR benchmark comparison workflow - Modified benchmark workflow to output JSON format - Added github-action-benchmark to compare PR vs master - Enabled automated PR comments with performance delta - Set alert threshold at 150% performance degradation Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com> --- .github/workflows/benchmark.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 367b35d9..fa38c738 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -20,6 +20,10 @@ on: - master pull_request: +permissions: + contents: write + pull-requests: write + jobs: benchmark: name: Benchmark @@ -28,23 +32,43 @@ jobs: - name: Checkout id: checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup CMake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.25.x' + - name: Configuring CMake files id: building-files run: | mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE:STRING=Release + - name: Building library id: building-lib run: | cd build && cmake --build . --config Release --target all -j 10 -- + - name: Run Benchmark id: run-benchmark run: | cd ./build/tests/benchmarks - ./casbin_benchmark + ./casbin_benchmark --benchmark_format=json --benchmark_out=benchmark_result.json + + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + tool: 'googlecpp' + output-file-path: ./build/tests/benchmarks/benchmark_result.json + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + alert-threshold: '150%' + comment-on-alert: true + fail-on-alert: false + alert-comment-cc-users: '@casbin/casbin-cpp' + summary-always: true + - name: Cleanup id: clean-up run: | From 5f43e4e6b0f538cce88d8a4b8ca58391a25ac12f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:11:24 +0000 Subject: [PATCH 3/4] fix: remove invalid alert-comment-cc-users parameter Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com> --- .github/workflows/benchmark.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index fa38c738..affe08f7 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -66,7 +66,6 @@ jobs: alert-threshold: '150%' comment-on-alert: true fail-on-alert: false - alert-comment-cc-users: '@casbin/casbin-cpp' summary-always: true - name: Cleanup From 9787df1614ee9a4d56d31a1ff09d54f5b4d634db Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:12:51 +0000 Subject: [PATCH 4/4] chore: fix trailing spaces in benchmark workflow Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com> --- .github/workflows/benchmark.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index affe08f7..15292fb6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -34,28 +34,28 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Setup CMake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.25.x' - + - name: Configuring CMake files id: building-files run: | mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE:STRING=Release - + - name: Building library id: building-lib run: | cd build && cmake --build . --config Release --target all -j 10 -- - + - name: Run Benchmark id: run-benchmark run: | cd ./build/tests/benchmarks ./casbin_benchmark --benchmark_format=json --benchmark_out=benchmark_result.json - + - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: @@ -67,7 +67,7 @@ jobs: comment-on-alert: true fail-on-alert: false summary-always: true - + - name: Cleanup id: clean-up run: |