Skip to content

try fixing benchmarks #709

try fixing benchmarks

try fixing benchmarks #709

Workflow file for this run

name: Benchmark
on:
pull_request:
branches: [main]
workflow_dispatch:
env:
FORCE_COLOR: "1"
PY_COLORS: "1"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: {}
jobs:
benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
env:
PYTEST_BENCHMARK_STORAGE: file://${{ github.workspace }}/.benchmarks
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Upgrade pip and nox
run: python -m pip install --upgrade pip nox pytest-benchmark
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git checkout ${{ github.event.pull_request.base.sha }}
- name: Benchmark on base branch
run: nox -s bench -- --benchmark-json=base.json
- run: git checkout ${GITHUB_SHA}
- name: Benchmark on pull request
run: |
nox -s bench -- --benchmark-json=pr.json
- uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'pytest'
output-file-path: pr.json
comment-on-alert: true
summary-always: true
external-data-json-path: base.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}