mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-08 02:37:52 +02:00
Extract a composite GitHub Action for Python + uv setup, replacing 12
scattered `astral-sh/setup-uv@v7` calls with a single reusable
`uv_setup` action that scopes cache dependency globs per library. Also
tightens issue template language and fixes a broken expression in the
release-test workflow.
## Changes
- Add `.github/actions/uv_setup/action.yml` — composite action wrapping
`astral-sh/setup-uv@v7` with a `working-directory` input that scopes
`cache-dependency-glob` to `<dir>/pyproject.toml`, `<dir>/uv.lock`, and
`<dir>/requirements*.txt`
- Migrate all workflow files (`_test.yml`, `_lint.yml`,
`_test_langgraph.yml`, `_integration_test.yml`, `baseline.yml`,
`bench.yml`, `ci.yml`, `release.yml`, `_test_release.yml`,
`uv_lock_ugprade.yml`) from inline `astral-sh/setup-uv@v7` to
`./.github/actions/uv_setup`, passing library-specific
`working-directory` for cache scoping
- Fix typo in `_test_release.yml` step name: `$${ env.PYTHON_VERSION }}`
→ `${{ env.PYTHON_VERSION }}`
- Disable uv cache for the release smoke-test job (`enable-cache:
false`) since it installs from PyPI, not the local lockfile
- Update `config.yml` API reference URL to point to `/python/langgraph/`
instead of `/python/`
- Tighten `privileged.yml` — shorter description, add English language
policy link, add "do not begin work unless assigned" notice
72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
name: bench
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "libs/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
benchmark:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: libs/langgraph
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- id: files
|
|
name: Get changed files
|
|
uses: Ana06/get-changed-files@v2.3.0
|
|
with:
|
|
format: json
|
|
- name: Set up Python 3.11
|
|
uses: ./.github/actions/uv_setup
|
|
with:
|
|
python-version: "3.11"
|
|
cache-suffix: "bench"
|
|
working-directory: libs/langgraph
|
|
- name: Install dependencies
|
|
run: uv sync --group test
|
|
- name: Download baseline
|
|
uses: actions/cache/restore@v5
|
|
with:
|
|
key: ${{ runner.os }}-benchmark-baseline
|
|
restore-keys: |
|
|
${{ runner.os }}-benchmark-baseline-
|
|
fail-on-cache-miss: true
|
|
path: |
|
|
libs/langgraph/out/benchmark-baseline.json
|
|
- name: Run benchmarks
|
|
id: benchmark
|
|
run: |
|
|
{
|
|
echo 'OUTPUT<<EOF'
|
|
make -s benchmark-fast
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
- name: Compare benchmarks
|
|
id: compare
|
|
run: |
|
|
{
|
|
echo 'OUTPUT<<EOF'
|
|
mv out/benchmark-baseline.json out/main.json
|
|
mv out/benchmark.json out/changes.json
|
|
uv run pyperf compare_to out/main.json out/changes.json --table --group-by-speed
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
- name: Annotation
|
|
uses: actions/github-script@v8
|
|
with:
|
|
script: |
|
|
const file = JSON.parse(`${{ steps.files.outputs.added_modified_renamed }}`)[0]
|
|
core.notice(`${{ steps.benchmark.outputs.OUTPUT }}`, {
|
|
title: 'Benchmark results',
|
|
file,
|
|
})
|
|
core.notice(`${{ steps.compare.outputs.OUTPUT }}`, {
|
|
title: 'Comparison against main',
|
|
file,
|
|
})
|