Skip to content

Commit 9c4b35a

Browse files
committed
Parallelize codspeed
Currently benchmarking takes much longer than the other jobs, parallelizing it speeds up the time to completion.
1 parent 26346af commit 9c4b35a

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555

5656
benchmarks:
5757
runs-on: ubuntu-22.04
58+
strategy:
59+
matrix:
60+
shard: [1,2]
61+
5862
steps:
5963
- uses: actions/checkout@v4
6064

@@ -74,11 +78,11 @@ jobs:
7478
run: |
7579
python -VV
7680
uv venv
77-
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
81+
uv pip install pytest==7.4.4 pyyaml==6.0.1 pytest-codspeed==3.2.0 pytest-test-groups==1.2.0 Django==5.1.1 /home/runner/work/grimp/grimp
7882
7983
- name: Run benchmarks
8084
uses: CodSpeedHQ/action@v3
8185
with:
8286
token: ${{ secrets.CODSPEED_TOKEN }}
8387
run: |
84-
uv run pytest tests/benchmarking/ --codspeed
88+
uv run pytest tests/benchmarking/ --codspeed --test-group=${{ matrix.shard }} --test-group-by filename --test-group-count=2

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ deps =
7777
pytest==7.4.4
7878
pyyaml==6.0.1
7979
pytest-codspeed==3.2.0
80+
pytest-test-groups==1.2.0
8081
Django==5.1.1
8182
commands =
82-
pytest --codspeed {posargs}
83+
pytest --codspeed tests/benchmarking {posargs}
8384

8485

8586
[testenv:docs]

0 commit comments

Comments
 (0)