From cbdeacc48a309adf83e8e6ea89bb7d096d7456d7 Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:18:40 +0200 Subject: [PATCH] Create benchmark.yml --- .github/workflows/benchmark.yml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 000000000..f0e8a674b --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,42 @@ +name: Run performance benchmark +on: + pull_request: + types: + - labeled + - synchronize + workflow_dispatch: + +permissions: + contents: write + deployments: write + +jobs: + benchmark: + if: contains(github.event.label.name, 'benchmark') || github.event_name == 'workflow_dispatch' + name: Run pytest-benchmark with pixi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup pixi environment + uses: prefix-dev/setup-pixi@v0.8.1 + with: + pixi-version: v0.29.0 + cache: true + auth-host: prefix.dev + auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} + + - name: Run benchmark + run: pixi run benchmark + + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: Python Benchmark with pytest-benchmark + tool: 'pytest' + output-file-path: tests/output.json + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: true + alert-threshold: '200%' + comment-on-alert: true + fail-on-alert: true