Skip to content

Commit c968dfe

Browse files
committed
ci: switch to sharded upload
1 parent 651d394 commit c968dfe

File tree

3 files changed

+42
-25
lines changed

3 files changed

+42
-25
lines changed

.github/workflows/codspeed.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@ on:
88

99
env:
1010
PYTHON_VERSION: "3.12"
11+
SHARDS: 4
1112

1213
jobs:
1314
benchmarks-instrumentation:
1415
strategy:
1516
matrix:
16-
include:
17-
- mode: "instrumentation"
18-
runs-on: ubuntu-24.04
19-
- mode: "walltime"
20-
runs-on: codspeed-macro
17+
shard: [0, 1, 2, 3]
18+
mode: ["instrumentation", "walltime"]
2119

22-
name: Run ${{ matrix.mode }} benchmarks
23-
runs-on: ${{ matrix.runs-on }}
20+
name: Run ${{ matrix.mode }} benchmarks (Shard \#${{ matrix.shard }})
21+
runs-on: ${{ matrix.mode == 'instrumentation' && 'ubuntu-24.04' || 'codspeed-macro' }}
2422
steps:
2523
- uses: actions/checkout@v4
2624
with:
2725
submodules: "recursive"
26+
- name: Install required-version defined in uv.toml
27+
uses: astral-sh/setup-uv@v5
2828
- uses: actions/setup-python@v2
2929
with:
3030
python-version: ${{ env.PYTHON_VERSION }}
3131
- name: Install local version of pytest-codspeed
3232
run: |
3333
sudo apt-get update
3434
sudo apt-get install valgrind -y
35-
pip install .
35+
uv sync --dev
3636
sudo apt-get remove valgrind -y
3737
- name: Run benchmarks
3838
uses: CodSpeedHQ/action@main
3939
with:
40-
run: pytest tests/benchmarks/ --codspeed
40+
run: uv run pytest tests/benchmarks/ --codspeed --test-group=${{ matrix.shard }} --test-group-count=${{ env.SHARDS }}
4141
token: ${{ secrets.CODSPEED_TOKEN }}

pyproject.toml

+8-3
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,24 @@ dependencies = [
3737
]
3838

3939
[project.optional-dependencies]
40-
lint = ["mypy ~= 1.11.2", "ruff ~= 0.6.5"]
4140
compat = [
4241
"pytest-benchmark ~= 5.0.0",
4342
"pytest-xdist ~= 3.6.1",
4443
# "pytest-speed>=0.3.5",
4544
]
46-
test = ["pytest ~= 7.0", "pytest-cov ~= 4.0.0"]
4745

4846
[tool.uv.sources]
4947
pytest-codspeed = { workspace = true }
5048

5149
[dependency-groups]
52-
dev = ["pytest-codspeed"]
50+
dev = [
51+
"pytest-codspeed",
52+
"mypy ~= 1.11.2",
53+
"ruff ~= 0.6.5",
54+
"pytest ~= 7.0",
55+
"pytest-cov ~= 4.0.0",
56+
"pytest-test-groups>=1.1.0",
57+
]
5358

5459
[project.entry-points]
5560
pytest11 = { codspeed = "pytest_codspeed.plugin" }

uv.lock

+25-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)