mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-17 18:10:32 +00:00
49 lines
1.3 KiB
YAML
49 lines
1.3 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
|
|
with:
|
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
|
run: |
|
|
cd ${{ inputs.working-directory }}
|
|
uv run --no-sync pytest ./tests/benchmarks --codspeed
|
|
mode: walltime
|