From f23190944db12b170551551259232d1f8c4803f3 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 21 Nov 2023 17:21:21 +0200 Subject: [PATCH] gha: run benchmarks --- .github/workflows/tests.yml | 3 +++ noxfile.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f28a50a..536aaf4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,5 +49,8 @@ jobs: - name: Upload coverage report uses: codecov/codecov-action@v3.1.1 + - name: Run benchmarks + run: nox -s bench-${{ matrix.nox_pyv || matrix.pyv }} + - name: Build package run: nox -s build diff --git a/noxfile.py b/noxfile.py index 820e12c..ac43568 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,6 +21,19 @@ def tests(session: nox.Session) -> None: ) +@nox.session +def bench(session: nox.Session) -> None: + session.install(".[tests]") + storage = os.getenv("PYTEST_BENCHMARK_STORAGE", "file://.benchmarks") + session.run( + "pytest", + "--benchmark-storage", + storage, + "--benchmark-only", + *session.posargs, + ) + + @nox.session def lint(session: nox.Session) -> None: session.install("pre-commit")