forked from music-assistant/server
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (65 loc) · 2.6 KB
/
Copy pathcodspeed.yml
File metadata and controls
74 lines (65 loc) · 2.6 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
name: CodSpeed
on:
push:
branches:
- stable
- dev
paths: &benchmark_paths
# helper functions exercised by the benchmarks
- "music_assistant/helpers/**"
# the benchmarks and toolchain itself
- "tests/benchmarks/**"
- ".github/workflows/codspeed.yml"
- "pyproject.toml"
- "requirements_all.txt"
pull_request:
branches:
- stable
- dev
paths: *benchmark_paths
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
permissions:
contents: read
id-token: write # for OpenID Connect authentication with CodSpeed
# Keep urllib3-future from hijacking the urllib3 namespace (see pyproject.toml).
env:
URLLIB3_NO_OVERRIDE: "1"
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out code from GitHub
uses: actions/checkout@v7
- name: Set up Python
# Pin an exact patch (not .python-version's "3.14") so the interpreter is
# identical across runs and CodSpeed's instruction counts stay comparable;
# check-latest is omitted so a new 3.14.x can't silently change the runtime.
uses: actions/setup-python@v7.0.0
with:
python-version: "3.14.6"
- name: Install uv
run: pip install uv
- name: Cache uv packages
uses: actions/cache@v6
with:
path: ~/.cache/uv
key: uv-${{ runner.os }}-${{ hashFiles('.python-version') }}-${{ hashFiles('requirements_all.txt', 'pyproject.toml') }}
- name: Install dependencies
# --index-strategy: allow PyPI packages when also using the PyTorch extra index
# https://docs.astral.sh/uv/pip/compatibility/#packages-that-exist-on-multiple-indexes
run: uv pip install --system --index-strategy unsafe-best-match . .[test] -r requirements_all.txt
- name: Run benchmarks
uses: CodSpeedHQ/action@f99becdce5e5d51fd556489ebef684f4ecfd6286 # v4.18.5
with:
mode: simulation
# tests/benchmarks/ holds only deterministic pure-function benchmarks, so their
# instruction counts are reproducible under simulation. Server-level / async
# scenarios are non-deterministic under instruction counting and are covered by
# the scripts/perf/ deep-dive suite instead.
# -o addopts="" clears the default "--cov music_assistant" so coverage
# instrumentation does not interfere with the CodSpeed measurements.
run: pytest tests/benchmarks/ --codspeed -o addopts=""