-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (69 loc) · 3.14 KB
/
Copy pathcodspeed.yml
File metadata and controls
77 lines (69 loc) · 3.14 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
77
# CodSpeed performance-regression gate — Horizon-A H-4.
#
# NON-required, observe-first: runs the opt-in pytest-codspeed micro-benchmarks
# (tests/benchmarks/, excluded from the default collection) under CodSpeed's
# instruction-counting runner and reports per-PR perf deltas. Never a merge
# gate (this job name is not in the branch ruleset's required checks, and it is
# continue-on-error).
#
# REPORTING: the repo is registered on codspeed.io (the CodSpeed GitHub App,
# free OSS tier), so the action uploads instruction-count results and reports
# per-PR perf deltas via the CodSpeed dashboard + PR comment. Public repo ->
# the upload token is omitted (tokenless); id-token: write enables CodSpeed's
# OpenID Connect authentication. continue-on-error keeps a transient upload
# failure non-blocking (observe-first); perf-regression signal comes from the
# PR comment, not from failing this step.
name: codspeed
on:
push:
branches: [main]
pull_request:
branches: [main]
# workflow_dispatch lets CodSpeed trigger a backtest to seed initial data.
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: codspeed-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
benchmarks:
name: codspeed benchmarks (pilot, non-blocking)
runs-on: ubuntu-latest
# Bound the run: the CodSpeed Valgrind instrumentation of tests/benchmarks/
# plus the workspace sync is open-ended; cap it so a stuck benchmark or a
# hung upload can't tie up a runner (this observe-first pilot is non-blocking,
# but a hang would still consume minutes).
timeout-minutes: 20
permissions:
contents: read
id-token: write # OpenID Connect auth for the tokenless CodSpeed upload
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Sync workspace
env:
EVIDENTIA_SKIP_FRONTEND_BUILD: "1"
run: uv sync --all-packages
- name: Run CodSpeed benchmarks
# step-level continue-on-error: this is an observe-first, non-required
# pilot — a transient CodSpeed upload/outage must not surface as a red PR
# check. CodSpeed reports perf deltas via its dashboard + PR comment, not
# by failing this step, so keeping it non-blocking loses no regression signal.
continue-on-error: true
uses: CodSpeedHQ/action@f99becdce5e5d51fd556489ebef684f4ecfd6286 # v4.18.5
with:
# v4 requires an explicit instrument mode. `simulation` is the Valgrind
# instruction-counting instrument (deterministic, hardware-independent)
# that runs on standard ubuntu-latest runners; `walltime` would require
# dedicated CodSpeed macro runners. (v4 renamed the old `instrumentation`.)
mode: simulation
run: uv run --no-sync python -m pytest tests/benchmarks/ --codspeed