Debian Codegraph @

.github/workflows/codspeed.yaml

raw
1 name: CodSpeed (simulation)
2
3 # In-process benches under callgraph instrumentation for per-function
4 # attribution on the dashboard. Cold-start subprocess benches need
5 # wall-clock measurement and live in codspeed-walltime.yaml.
6
7 on:
8 push:
9 branches:
10 - main
11 - maintenance/**
12 pull_request:
13 # `workflow_dispatch` allows CodSpeed to trigger backtest
14 # performance analysis in order to generate initial data.
15 workflow_dispatch:
16
17 concurrency:
18 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19 cancel-in-progress: true
20
21 permissions:
22 contents: read
23
24 jobs:
25 benchmarks:
26 name: Run benchmarks
27 runs-on: ubuntu-latest
28 # mode: simulation captures a callgraph per benchmark for per-function
29 # attribution on the dashboard. That instrumentation is ~10-50x slower
30 # than wall-clock, so end-to-end benches over real codebases need
31 # generous budget. The 3-bench suite takes ~22 min on the baseline;
32 # a perf regression PR can easily double that.
33 timeout-minutes: 60
34 steps:
35 - name: Check out code from GitHub
36 uses: actions/[email protected]
37
38 - name: Set up Python 3.14
39 id: python
40 uses: actions/[email protected]
41 with:
42 python-version: "3.14"
43 check-latest: true
44
45 - name: Install dependencies
46 run: |
47 python -m pip install -U pip
48 pip install pytest-codspeed
49 pip install .
50
51 - name: Run in-process benchmarks
52 uses: CodSpeedHQ/[email protected]
53 with:
54 mode: simulation
55 # Skip cold_lint here — it shells out to a subprocess that
56 # simulation mode cannot see into; see codspeed-walltime.yaml.
57 run: pytest tests/benchmarks/ --codspeed -k "not cold_lint"