From 7efd6aec33924afffa77d71d39bcbf704ac01a20 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 | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f28a50a..ddaedfb 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 + - name: Build package run: nox -s build diff --git a/noxfile.py b/noxfile.py index 820e12c..82eb4ec 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,6 +21,21 @@ 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", + "--benchmark-group-by", + "func", + *session.posargs, + ) + + @nox.session def lint(session: nox.Session) -> None: session.install("pre-commit")