|
name: CodSpeed |
|
|
|
permissions: |
|
contents: read |
|
|
|
on: |
|
push: |
|
branches: |
|
- "main" |
|
paths: |
|
- "commit_check/**" |
|
- "tests/**" |
|
- ".github/workflows/codspeed.yml" |
|
- "pyproject.toml" |
|
pull_request: |
|
branches: |
|
- "main" |
|
paths: |
|
- "commit_check/**" |
|
- "tests/**" |
|
- ".github/workflows/codspeed.yml" |
|
- "pyproject.toml" |
|
# `workflow_dispatch` allows CodSpeed to trigger backtest |
|
# performance analysis in order to generate initial data. |
|
workflow_dispatch: |
|
|
|
jobs: |
|
benchmarks: |
|
name: Run benchmarks |
|
runs-on: ubuntu-latest |
|
steps: |
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
|
with: |
|
python-version: "3.13" |
|
|
|
- name: Install dependencies |
|
run: pip install -e .[test] |
|
|
|
- name: Run benchmarks |
|
uses: CodSpeedHQ/action@4296e51e7041e24dadb86d1d6e8b9320d223dbe8 # v5.0.3 |
|
with: |
|
token: ${{ secrets.CODSPEED_TOKEN }} |
|
run: pytest tests/ --codspeed |
|
mode: simulation # https://codspeed.io/docs/instruments |