Files
langchain/.github/workflows/codspeed.yml
Chester Curme bde0bf2569 fixes
2025-05-21 10:53:47 -04:00

60 lines
1.9 KiB
YAML

name: CodSpeed
on:
# Re-usable workflow
workflow_call:
inputs:
working-directory:
required: true
type: string
description: "From which folder this pipeline executes"
python-version:
required: true
type: string
description: "Python version to use"
# Manual run (you will be prompted for the two inputs)
workflow_dispatch:
jobs:
codspeed:
name: Run benchmarks
if: contains(github.event.pull_request.labels.*.name, 'run-codspeed-benchmarks') || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ inputs.python-version }}
# Using this action is still necessary for CodSpeed to work
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: install deps
run: uv sync --group test
working-directory: ${{ inputs.working-directory }}
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
env:
AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_API_BASE: ${{ secrets.AZURE_OPENAI_API_BASE }}
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_LEGACY_CHAT_DEPLOYMENT_NAME }}
DEEPSEEK_API_KEY: foo
FIREWORKS_API_KEY: foo
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: |
cd ${{ inputs.working-directory }}
if [ "${{ inputs.working-directory }}" = "libs/core" ]; then
uv run --no-sync pytest ./tests/benchmarks --codspeed
else
uv run --no-sync pytest ./tests/ --codspeed
fi
mode: walltime