From 530ec905413a7a2e96c7baa789a4a2ff1c689c94 Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Tue, 11 Jul 2023 21:25:19 +0100 Subject: [PATCH] Fix action --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++-- noxfile.py | 7 ------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 964d599f40..acad080a62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,6 +85,32 @@ jobs: fail_ci_if_error: true verbose: true + benchmarks: + name: 📈 Benchmarks + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + - run: pipx install poetry + - uses: actions/setup-python@v4 + id: setup-python + with: + python-version: "3.11" + architecture: x64 + cache: "poetry" + + - run: poetry env use 3.11 + - run: poetry install + if: steps.setup-python.outputs.cache-hit != 'true' + + - name: Run benchmarks + uses: CodSpeedHQ/action@v1 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: pytest tests/benchmarks --codspeed + lint: name: ✨ Lint runs-on: ubuntu-latest @@ -135,8 +161,8 @@ jobs: ~/.nox .nox key: - ${{ runner.os }}-nox-windows-${{ - hashFiles('**/poetry.lock') }}-${{ hashFiles('**/noxfile.py') }} + ${{ runner.os }}-nox-windows-${{ hashFiles('**/poetry.lock') }}-${{ + hashFiles('**/noxfile.py') }} restore-keys: | ${{ runner.os }}-nox-windows ${{ runner.os }}-nox- diff --git a/noxfile.py b/noxfile.py index 89db42c3d6..6630690efe 100644 --- a/noxfile.py +++ b/noxfile.py @@ -30,13 +30,6 @@ def tests(session: Session) -> None: ) -@session(python=PYTHON_VERSIONS, name="Benchmarks", tags=["tests", "benchmarks"]) -def benchmarks(session: Session) -> None: - session.run_always("poetry", "install", external=True) - - session.run("pytest", "--codspeed", "tests/benchmarks") - - @session(python=["3.11"], name="Django tests", tags=["tests"]) @nox.parametrize("django", ["4.2.0", "4.1.0", "4.0.0", "3.2.0"]) def tests_django(session: Session, django: str) -> None: