| 1 |
name: CodSpeed (walltime) |
| 2 |
|
| 3 |
# Cold-start benchmarks (currently just test_bench_endtoend_cold_lint) |
| 4 |
# shell out to a fresh Python subprocess. mode: simulation only measures |
| 5 |
# Python-side instructions and would report the subprocess as ~300 µs of |
| 6 |
# subprocess.run overhead. mode: walltime measures the wall-clock end to |
| 7 |
# end including the subprocess, which is what we want. |
| 8 |
# |
| 9 |
# Walltime on a shared GitHub runner is noisier than CodSpeed's dedicated |
| 10 |
# macro runners. If cold_lint starts producing false-positive regressions, |
| 11 |
# raise its per-benchmark threshold on the CodSpeed dashboard (Actions |
| 12 |
# menu on the benchmark page). |
| 13 |
|
| 14 |
on: |
| 15 |
push: |
| 16 |
branches: |
| 17 |
- main |
| 18 |
- maintenance/** |
| 19 |
pull_request: |
| 20 |
workflow_dispatch: |
| 21 |
|
| 22 |
concurrency: |
| 23 |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 24 |
cancel-in-progress: true |
| 25 |
|
| 26 |
permissions: |
| 27 |
contents: read |
| 28 |
|
| 29 |
jobs: |
| 30 |
benchmarks: |
| 31 |
name: Run cold-start benchmarks |
| 32 |
runs-on: ubuntu-latest |
| 33 |
timeout-minutes: 15 |
| 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 |
# Install pylint first (it pulls in a published astroid as a |
| 49 |
# dependency); the install below then replaces that astroid |
| 50 |
# with the version under test. pylint is invoked as a |
| 51 |
# subprocess by the cold-start benchmark. |
| 52 |
pip install pylint pytest-codspeed |
| 53 |
pip install . |
| 54 |
|
| 55 |
- name: Run cold-start benchmarks |
| 56 |
uses: CodSpeedHQ/[email protected] |
| 57 |
with: |
| 58 |
mode: walltime |
| 59 |
run: pytest tests/benchmarks/ --codspeed -k "cold_lint" |