Skip to content

Commit ceeb039

Browse files
Try out Codespeed (#127)
* Try out Codespeed Signed-off-by: Bradley Reynolds <[email protected]> * Add explicit permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: Bradley Reynolds <[email protected]> --------- Signed-off-by: Bradley Reynolds <[email protected]> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent ca71f82 commit ceeb039

File tree

4 files changed

+177
-0
lines changed

4 files changed

+177
-0
lines changed

.github/workflows/codspeed.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Codspeed
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
jobs:
13+
codspeed:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
22+
with:
23+
python-version: 3.13
24+
cache: pip
25+
cache-dependency-path: uv.lock
26+
27+
- name: Update packaging tools
28+
run: python -m pip install --upgrade pip wheel setuptools build
29+
30+
- name: Install dependencies
31+
run: python -m pip install .[tests]
32+
33+
- uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0
34+
with:
35+
run: pytest tests/ --codspeed
36+
token: ${{ secrets.CODSPEED_TOKEN }}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dev = [
2525
tests = [
2626
"pytest>=8.4.1",
2727
"pytest-randomly>=3.16.0",
28+
"pytest-codspeed>=4.0.0",
2829
]
2930
docs = [
3031
"sphinx",

tests/test_uwuification.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_char_replace(in_text: str, out_text: str) -> None:
5353
(1.0, "I love dogs", "I l-love d-dogs"),
5454
],
5555
)
56+
@pytest.mark.benchmark
5657
def test_stutter(strength: float, in_text: str, out_text: str) -> None:
5758
"""Test adding stutters to text."""
5859
assert stutter(in_text, strength) == out_text

0 commit comments

Comments
 (0)