-
Notifications
You must be signed in to change notification settings - Fork 80
76 lines (71 loc) · 2.26 KB
/
Copy pathcodspeed.yml
File metadata and controls
76 lines (71 loc) · 2.26 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CodSpeed
# Both instruments in one workflow (CodSpeed aggregates per-commit results from a
# single workflow). Memory: heap tracking on a free GitHub runner, every PR +
# master. Walltime: bare-metal macro runner, master + the maintainer-gated
# `trigger:benchmark` label only.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened, labeled ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
memory:
name: Memory (heap)
runs-on: ubuntu-latest
continue-on-error: true # informational, never blocks a merge
permissions:
contents: read # actions/checkout
id-token: write # OIDC auth with CodSpeed — no token secret
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools_scm
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install pinned benchmark environment
run: |
python -m pip install uv
uv pip install --system -e ".[dev,benchmarks]"
- name: Run benchmarks under CodSpeed (memory)
uses: CodSpeedHQ/action@v4
with:
mode: memory
run: |
pytest benchmarks/ --codspeed
walltime:
name: Walltime (macro runner)
# Master push / dispatch always; PRs only when explicitly labelled — macro
# minutes are metered and bare-metal shouldn't run arbitrary PR code.
if: >-
${{ github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'trigger:benchmark') }}
runs-on: codspeed-macro
continue-on-error: true
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # setuptools_scm
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install pinned benchmark environment
run: |
python -m pip install uv
uv pip install --system -e ".[dev,benchmarks]"
- name: Run benchmarks under CodSpeed (walltime)
uses: CodSpeedHQ/action@v4
with:
mode: walltime
run: |
pytest benchmarks/ --codspeed