Merge pull request #154 from Janelia-Trackathon-2023/pre-commit-ci-up… #44
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 | |
# Do not run this workflow on pull request since this workflow has permission to modify contents. | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
jobs: | |
benchmark: | |
name: Report benchmarks on gh-pages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache-dependency-path: "pyproject.toml" | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install -e .[test] | |
- name: Run benchmark | |
run: | | |
pytest tests/bench.py --benchmark-json output.json | |
- name: Store benchmark results | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Python Benchmark with pytest-benchmark | |
tool: 'pytest' | |
output-file-path: output.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
auto-push: true |