File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 1+ name : CodSpeed
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ workflow_dispatch :
9+
10+ permissions :
11+ contents : read
12+ id-token : write
13+
14+ jobs :
15+ codspeed :
16+ name : Run benchmarks
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v4
20+ - name : Setup Python
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : " 3.12"
24+ - name : Install dependencies
25+ run : pip install -r requirements.txt
26+ - name : Build Python package with maturin
27+ uses : PyO3/maturin-action@v1
28+ with :
29+ args : --release --out dist
30+ - name : Install base64_utils
31+ run : pip install base64_utils --no-index --find-links dist --force-reinstall
32+ - name : Run benchmarks
33+ uses : CodSpeedHQ/action@v4.5.2
34+ with :
35+ mode : simulation
36+ run : pytest tests/test_benchmarks.py --codspeed
Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ mkdocs==1.6.1
22mkdocs-material == 9.5.34
33mypy == 1.19.0
44pytest == 9.0.1
5+ pytest-codspeed == 4.2.0
56ruff == 0.14.7
67richbench == 1.0.3
Original file line number Diff line number Diff line change 1+ import base64_utils
2+ import pytest
3+
4+ pytest .importorskip ("pytest_codspeed" )
5+
6+
7+ @pytest .mark .benchmark
8+ def test_b64encode () -> None :
9+ base64_utils .b64encode (b"test data" )
10+
11+
12+ @pytest .mark .benchmark
13+ def test_b64encode_altchars () -> None :
14+ base64_utils .b64encode (b"test data" , altchars = b"-_" )
You can’t perform that action at this time.
0 commit comments