mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 14:43:07 +00:00
80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
name: CodSpeed
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths:
|
|
- 'libs/core/**'
|
|
- 'libs/partners/**'
|
|
|
|
workflow_dispatch:
|
|
|
|
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
|
|
|
|
jobs:
|
|
prepare_matrix:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
python-version: "3.12"
|
|
- id: files
|
|
uses: Ana06/get-changed-files@v2.3.0
|
|
- id: set-matrix
|
|
run: |
|
|
uv venv
|
|
uv pip install packaging requests
|
|
uv run .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
|
|
outputs:
|
|
codspeed: ${{ steps.set-matrix.outputs.codspeed }}
|
|
codspeed:
|
|
name: Run benchmarks
|
|
needs: [ prepare_matrix ]
|
|
if: ${{ needs.prepare_matrix.outputs.codspeed != '[]' }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
job-configs: ${{ fromJson(needs.prepare_matrix.outputs.codspeed) }}
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# We have to use 3.12 as 3.13 is not yet supported
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v6
|
|
with:
|
|
python-version: ${{ matrix.job-configs.python-version }}
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.job-configs.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --group test
|
|
working-directory: ${{ matrix.job-configs.working-directory }}
|
|
|
|
- name: Run benchmarks ${{ split(matrix.job-configs.working-directory, '/') | last }}
|
|
uses: CodSpeedHQ/action@v3
|
|
with:
|
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
|
run: |
|
|
cd ${{ matrix.job-configs.working-directory }}
|
|
if [ "${{ matrix.job-configs.working-directory }}" = "libs/core" ]; then
|
|
uv run --no-sync pytest ./tests/benchmarks --codspeed
|
|
else
|
|
uv run --no-sync pytest ./tests/ --codspeed
|
|
fi
|
|
mode: ${{ matrix.job-configs.working-directory == 'libs/core' && 'walltime' || 'instrumentation' }}
|
|
|