From c6b097aa5b6f1bae5231d17db7d595a0bb2a7b26 Mon Sep 17 00:00:00 2001 From: Vincent Sarago Date: Wed, 27 Jul 2022 12:47:44 +0200 Subject: [PATCH] add github-action-benchmark (#504) * add github-action-benchmark * edit action name --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a97d21f9..7cfd56ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,22 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('./tests/benchmarks/__init__.py') }} - name: Run Benchmark - run: python -m pytest --benchmark-only --benchmark-autosave --benchmark-columns 'min, max, mean, median' --benchmark-sort 'min' + run: python -m pytest --benchmark-only --benchmark-autosave --benchmark-columns 'min, max, mean, median' --benchmark-sort 'min' --benchmark-json output.json + + - name: Store and Compare benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: rio-tiler Benchmarks + tool: 'pytest' + output-file-path: output.json + alert-threshold: '130%' + comment-on-alert: true + fail-on-alert: true + # GitHub API token to make a commit comment + github-token: ${{ secrets.GITHUB_TOKEN }} + # Make a commit on `gh-pages` only if master + auto-push: ${{ github.ref == 'refs/heads/master' }} + benchmark-data-dir-path: benchmarks publish: needs: [tests]