mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-31 12:19:58 +02:00
Add ci job
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
name: bench
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "libs/**"
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.7.1"
|
||||
|
||||
jobs:
|
||||
baseline:
|
||||
runs-on: ubuntu-latest
|
||||
working-directory: libs/langgraph
|
||||
name: "bench/baseline"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
ref: main
|
||||
- name: Set up Python 3.11 + Poetry ${{ env.POETRY_VERSION }}
|
||||
if: steps.changed-files.outputs.all
|
||||
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 bench
|
||||
- name: Upload benchmark baseline
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bench-baseline.json
|
||||
path: out/bench.json
|
||||
compare:
|
||||
runs_on: ubuntu-latest
|
||||
working-directory: libs/langgraph
|
||||
name: "bench/compare"
|
||||
needs: [baseline]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python 3.11 + Poetry ${{ env.POETRY_VERSION }}
|
||||
if: steps.changed-files.outputs.all
|
||||
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 bench
|
||||
- name: Download benchmark baseline
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bench-baseline.json
|
||||
path: out
|
||||
- name: Compare benchmarks
|
||||
run: poetry run pyperf compare_to out/bench-baseline.json out/bench.json --table --group-by-speed >> $GITHUB_OUTPUT
|
||||
- name: Annotation
|
||||
run: echo "::notice file=libs/langgraph/bench/__main__.py::$GITHUB_OUTPUT"
|
||||
Reference in New Issue
Block a user