Skip to content

Commit 656add7

Browse files
authored
CI: Speed up pytest workflow with pytest-xdist (#3257)
* Use pytest-xdist in pytest.yml * Add pip caching on pytest.yml
1 parent 843b41d commit 656add7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/pytest.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
uses: actions/setup-python@v4
3737
with:
3838
python-version: ${{ matrix.python-version }}
39+
cache: pip
3940

4041
- name: Install non-Python dependencies
4142
run: |
@@ -49,7 +50,7 @@ jobs:
4950
python -m pip install --upgrade pip
5051
pip install -r .github/workflows/python_requirements.txt
5152
pip install -r .github/workflows/optional_requirements.txt
52-
pip install pytest pytest-timeout pytest-github-actions-annotate-failures
53+
pip install pytest pytest-timeout pytest-github-actions-annotate-failures pytest-xdist
5354
5455
- name: Create installation directory
5556
run: |
@@ -73,7 +74,7 @@ jobs:
7374
run: |
7475
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
7576
export LD_LIBRARY_PATH=$HOME/install/grass84/lib:$LD_LIBRARY_PATH
76-
pytest .
77+
pytest --numprocesses auto .
7778
7879
- name: Print installed versions
7980
if: always()

0 commit comments

Comments
 (0)