diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 960f0fc8..47806a8c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,22 +56,29 @@ jobs: benchmarks: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Setup python + uses: actions/setup-python@v5 with: python-version: "3.13" allow-prereleases: true + # Temporarily install hardcoded dependencies here. + # Codspeed doesn't work well with tox, as it runs the tox installation process as part of the benchmarking + # process, which is very slow. - name: Install dependencies run: | python -VV - python -m site - python -m pip install --upgrade pip setuptools wheel - python -m pip install --upgrade tox tox-gh-actions + uv venv + uv pip install pytest==7.4.4 pyyaml==6.0.1 pytest-codspeed==3.2.0 Django==5.1.1 /home/runner/work/grimp/grimp - name: Run benchmarks uses: CodSpeedHQ/action@v3 with: token: ${{ secrets.CODSPEED_TOKEN }} - run: tox -ecodspeed + run: | + uv run pytest tests/benchmarking/ --codspeed diff --git a/.gitignore b/.gitignore index c6dbd00e..8898f647 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ coverage.xml htmlcov .benchmarks +.codspeed # Translations *.mo diff --git a/tox.ini b/tox.ini index 2830d425..3bdb2cb9 100644 --- a/tox.ini +++ b/tox.ini @@ -71,13 +71,15 @@ setenv = passenv = * usedevelop = false +# Note - these dependencies are duplicated in main.yml, make sure to change them there too. +# TODO: switch to UV for dependency management. deps = pytest==7.4.4 pyyaml==6.0.1 - pytest-codspeed==2.2.1 + pytest-codspeed==3.2.0 Django==5.1.1 commands = - {posargs:pytest --codspeed} + pytest --codspeed {posargs} [testenv:docs]