Skip to content

Commit

Permalink
Add CodSpeed profiling Actions workflow (#8054)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Lambert <bennett-spencer.lambert@pierer-innovation.com>
  • Loading branch information
lambertsbennett and benpinno committed Nov 13, 2023
1 parent f23578e commit 7df25da
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/codspeed.yml
@@ -0,0 +1,32 @@
name: codspeed

on:
push:
branches:
- main
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
codspeed-profiling:
name: codspeed profiling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
cache: true

- name: install deps
run: |
pdm venv create --with-pip --force $PYTHON
pdm install -G testing -G testing-extra -G email
- name: Run CodSpeed benchmarks
uses: CodSpeedHQ/action@v1
with:
run: pdm run pytest ./tests/benchmarks --codspeed
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -106,6 +106,7 @@ testing = [
"pytest-examples",
"faker>=18.13.0",
"pytest-benchmark>=4.0.0",
"pytest-codspeed~=2.2.0",
]
testing-extra = [
# used when generate devtools docs example
Expand Down

0 comments on commit 7df25da

Please sign in to comment.