Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/codspeed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Codspeed

permissions:
contents: read

on:
push:
branches:
- main
pull_request:

jobs:
codspeed:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: 3.13
cache: pip
cache-dependency-path: uv.lock

- name: Update packaging tools
run: python -m pip install --upgrade pip wheel setuptools build

- name: Install dependencies
run: python -m pip install .[tests]

- uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0
with:
run: pytest tests/ --codspeed
token: ${{ secrets.CODSPEED_TOKEN }}
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dev = [
tests = [
"pytest>=8.4.1",
"pytest-randomly>=3.16.0",
"pytest-codspeed>=4.0.0",
]
docs = [
"sphinx",
Expand Down
1 change: 1 addition & 0 deletions tests/test_uwuification.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_char_replace(in_text: str, out_text: str) -> None:
(1.0, "I love dogs", "I l-love d-dogs"),
],
)
@pytest.mark.benchmark
def test_stutter(strength: float, in_text: str, out_text: str) -> None:
"""Test adding stutters to text."""
assert stutter(in_text, strength) == out_text
Expand Down
Loading
Loading