Skip to content

Commit

Permalink
Use github-action-benchmark for continous benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Jan 23, 2023
1 parent e934ea6 commit 017f441
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
benchmark:
Expand All @@ -21,8 +24,24 @@ jobs:
- name: Set up benchmark environment
run: |
python -m pip install -U pip
pip install .
less requirements.txt | grep 'pytest\|chex' | xargs -i -t pip install {}
pip install -r requirements.txt
- name: Load previous benchmark data from cache
uses: actions/cache@v3
with:
path: ./benchmark-cache
key: benchmark
- name: Run benchmarks
run: |
pytest -vv -m benchmark
pytest --benchmark-only --benchmark-json output.json
- name: Write benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
name: Python Benchmark with pytest-benchmark
tool: 'pytest'
output-file-path: output.json
external-data-json-path: ./benchmark-cache/benchmark-data.json
alert-threshold: '200%'
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: ${{ github.event_name == 'push' }}
fail-on-alert: true
auto-push: false

0 comments on commit 017f441

Please sign in to comment.