Merge pull request #285 from alcides/dependabot/pip/mypy-1.15.0 #391
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python Benchmarking | |
on: | |
push: | |
branches: ["*"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install the latest version of uv and set the python version | |
uses: astral-sh/setup-uv@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
enable-cache: true | |
cache-dependency-glob: | | |
**/requirements*.txt | |
**/pyproject.toml | |
- name: Create venv | |
run: | | |
uv venv | |
- name: Install dependencies | |
run: | | |
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi | |
if [ -f requirements-dev.txt ]; then uv pip install -r requirements-dev.txt; fi | |
- name: Check install | |
run: | | |
uv pip install -e . | |
- name: Test with pytest | |
run: | | |
uv run --frozen pytest --benchmark-only --benchmark-json 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: output.json | |
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t/github-action-not-triggering-gh-pages-upon-push/16096 | |
github-token: ${{ secrets.BENCHMARK_REPO_TOKEN }} | |
gh-repository: github.com/alcides/GeneticEngineBenchmarkResults | |
auto-push: true | |
# Show alert with commit comment on detecting possible performance regression | |
alert-threshold: '200%' | |
comment-on-alert: true | |
alert-comment-cc-users: '@alcides' |