From 656add71cfc681c352ae2a23ec1d7c29b37c958f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Tue, 28 Nov 2023 09:29:11 -0500 Subject: [PATCH] CI: Speed up pytest workflow with pytest-xdist (#3257) * Use pytest-xdist in pytest.yml * Add pip caching on pytest.yml --- .github/workflows/pytest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index c18045c18f1..dd09b30d6cd 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -36,6 +36,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install non-Python dependencies run: | @@ -49,7 +50,7 @@ jobs: python -m pip install --upgrade pip pip install -r .github/workflows/python_requirements.txt pip install -r .github/workflows/optional_requirements.txt - pip install pytest pytest-timeout pytest-github-actions-annotate-failures + pip install pytest pytest-timeout pytest-github-actions-annotate-failures pytest-xdist - name: Create installation directory run: | @@ -73,7 +74,7 @@ jobs: run: | export PYTHONPATH=`grass --config python_path`:$PYTHONPATH export LD_LIBRARY_PATH=$HOME/install/grass84/lib:$LD_LIBRARY_PATH - pytest . + pytest --numprocesses auto . - name: Print installed versions if: always()