feature: Add automated benchmarking to GitHub #26
Workflow file for this run
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: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install juliaup | |
uses: julia-actions/[email protected] | |
with: | |
channel: '1' | |
- name: Update Julia registry | |
shell: julia --project=. --color=yes {0} | |
run: | | |
using Pkg | |
Pkg.Registry.update() | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
pip install -e .[test] # to put juliapkg.json in sys.path | |
python -c 'import juliacall' # force install of all deps | |
- name: Benchmark | |
run: | | |
pytest -n 0 benchmark/benchmark.py --benchmark-json=benchmark/output.json | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: Python Benchmark with pytest-benchmark | |
tool: 'pytest' | |
output-file-path: benchmark/output.json | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# don't auto-deploy to gh-pages for now | |
#auto-push: true | |
# Show alert with commit comment on detecting possible performance regression | |
skip-fetch-gh-pages: true | |
alert-threshold: '200%' | |
comment-on-alert: true | |
fail-on-alert: true |