Repository navigation
55 lines (49 loc) · 2.06 KB
/
Copy pathcodspeed.yml
File metadata and controls
55 lines (49 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Per-PR microbenchmarks: runs tests/bench under CodSpeed's simulation mode,
# which counts instructions instead of wall-clock time, so shared-runner noise
# mostly disappears. Results appear as CodSpeed's PR regression report.
#
# Runs with uv directly on the runner, not inside the devcontainer like
# checks.yml: CodSpeed's runner instruments the benchmark process itself
# (valgrind-based) and is documented for the plain-runner pattern; wrapping it
# in a container would hide the process from it. The benchmarks need no
# backing service (see tests/README.md).
name: CodSpeed
on:
push:
branches: [main]
pull_request:
# Lets CodSpeed trigger runs to seed baseline data.
workflow_dispatch:
permissions:
contents: read
jobs:
benchmarks:
# renovate: datasource=github-runners depName=ubuntu
runs-on: ${{ vars.CI_RUNNER || 'ubuntu-24.04' }}
permissions:
contents: read
# OIDC authentication with CodSpeed; the action's token input is only
# needed for private repositories.
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
enable-cache: true
# Same minor as the devcontainer's CPython (.devcontainer/Dockerfile's
# PYTHON_VERSION); otherwise uv picks the runner's newest Python that
# satisfies requires-python.
python-version: "3.14"
- name: Install dependencies
run: uv sync --locked --all-groups
- name: Run benchmarks
uses: CodSpeedHQ/action@821a40cd6c80e3cfe387caf55668287addd808da # v5.5.0
with:
mode: simulation
# pyproject.toml's cache_dir points into the devcontainer's home, which
# doesn't exist on this bare runner; use the runner's temp dir instead.
run: uv run pytest tests/bench --no-cov --codspeed -o cache_dir=${{ runner.temp }}/pytest-cache