ci: add CodSpeed workflow and pytest-codspeed for performance testing (#4350)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-11-02 10:06:14 -03:00 committed by GitHub
commit a7f28394ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 51 additions and 0 deletions

29
.github/workflows/codspeed.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: Run benchmarks
on:
push:
branches:
- "main" # or "master"
pull_request:
workflow_dispatch:
jobs:
codspeed:
name: Run benchmarks
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
steps:
- name: Check out the code at a specific ref
uses: actions/checkout@v4
- name: "Setup Environment"
uses: ./.github/actions/setup-uv
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: make unit_tests args="--codspeed -n auto"
- name: Minimize uv cache
run: uv cache prune --ci