Merge pull request #25 from secondlife/dependabot/github_actions/code… #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
permissions: | |
contents: write | |
deployments: write | |
jobs: | |
benchmark: | |
name: Run benchmarks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Run benchmarks | |
run: | | |
pip install .[dev] | |
pytest tests/bench.py --benchmark-json benchmark.json | |
- name: Report results | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Python Benchmarks | |
tool: pytest | |
output-file-path: benchmark.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Only update results if they are from main | |
auto-push: ${{ github.ref == 'refs/heads/main' }} | |
alert-threshold: "110%" | |
comment-on-alert: true |