Skip to content

Commit 096c161

Browse files
committed
Run benchmarks in CI
1 parent 9e13b91 commit 096c161

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

.ci/benchmark.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
python3 -m pip install pytest-benchmark
6+
7+
python3 -bb -m pytest -vv --benchmark-only --benchmark-autosave Tests/benchmark*

.github/workflows/test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ jobs:
163163
flags: ${{ matrix.os == 'ubuntu-latest' && 'GHA_Ubuntu' || 'GHA_macOS' }}
164164
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
165165

166+
- name: Run benchmarks
167+
run: |
168+
.ci/benchmark.sh
169+
170+
- name: Upload benchmarks
171+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
172+
with:
173+
name: benchmarks-${{ matrix.os }}-${{ matrix.python-version }}
174+
path: .benchmarks
175+
166176
success:
167177
permissions:
168178
contents: none

Tests/benchmarks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
TYPE_CHECKING = False
1616

1717
if TYPE_CHECKING:
18-
from pytest_benchmark.fixture import (
19-
BenchmarkFixture, # type: ignore[import-not-found]
18+
from pytest_benchmark.fixture import ( # type: ignore[import-not-found]
19+
BenchmarkFixture,
2020
)
2121

2222
pytest.importorskip(

0 commit comments

Comments
 (0)