mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-21 23:22:27 +02:00
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: bench
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "libs/**"
|
|
|
|
env:
|
|
POETRY_VERSION: "1.7.1"
|
|
|
|
jobs:
|
|
baseline:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: libs/langgraph
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
- name: Set up Python 3.11 + Poetry ${{ env.POETRY_VERSION }}
|
|
uses: "./.github/actions/poetry_setup"
|
|
with:
|
|
python-version: "3.11"
|
|
poetry-version: ${{ env.POETRY_VERSION }}
|
|
cache-key: bench
|
|
- name: Install dependencies
|
|
run: poetry install --with dev
|
|
- name: Run benchmarks
|
|
run: make benchmark
|
|
- name: Upload benchmark baseline
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-baseline.json
|
|
path: libs/langgraph/out/benchmark.json
|
|
compare:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: libs/langgraph
|
|
needs: [baseline]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python 3.11 + Poetry ${{ env.POETRY_VERSION }}
|
|
uses: "./.github/actions/poetry_setup"
|
|
with:
|
|
python-version: "3.11"
|
|
poetry-version: ${{ env.POETRY_VERSION }}
|
|
working-directory: libs/langgraph
|
|
cache-key: bench
|
|
- name: Install dependencies
|
|
run: poetry install --with dev
|
|
- name: Run benchmarks
|
|
run: make benchmark
|
|
- name: Download benchmark baseline
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: benchmark-baseline.json
|
|
path: out
|
|
- name: Compare benchmarks
|
|
run: poetry run pyperf compare_to out/benchmark-baseline.json out/benchmark.json --table --group-by-speed >> $GITHUB_OUTPUT
|
|
- name: Annotation
|
|
run: echo "::notice file=libs/langgraph/bench/__main__.py::$GITHUB_OUTPUT"
|