mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-06 03:27:55 +00:00
refactor: enhance workflow names and descriptions for clarity (#32262)
This commit is contained in:
parent
c6cb1fae61
commit
9d38f170ce
12
.github/workflows/_compile_integration_test.yml
vendored
12
.github/workflows/_compile_integration_test.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: compile-integration-test
|
name: '🔗 Compile Integration Tests'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -25,24 +25,24 @@ jobs:
|
|||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
name: "uv run pytest -m compile tests/integration_tests #${{ inputs.python-version }}"
|
name: 'Python ${{ inputs.python-version }}'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
- name: Install integration dependencies
|
- name: '📦 Install Integration Dependencies'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv sync --group test --group test_integration
|
run: uv sync --group test --group test_integration
|
||||||
|
|
||||||
- name: Check integration tests compile
|
- name: '🔗 Check Integration Tests Compile'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv run pytest -m compile tests/integration_tests
|
run: uv run pytest -m compile tests/integration_tests
|
||||||
|
|
||||||
- name: Ensure the tests did not create any additional files
|
- name: '🧹 Verify Clean Working Directory'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
10
.github/workflows/_integration_test.yml
vendored
10
.github/workflows/_integration_test.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Integration Tests
|
name: '🚀 Integration Tests'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -24,20 +24,20 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Python ${{ inputs.python-version }}
|
name: '🚀 Integration Tests (Python ${{ inputs.python-version }})'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Integration Dependencies'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv sync --group test --group test_integration
|
run: uv sync --group test --group test_integration
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: '🚀 Run Integration Tests'
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
|
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
|
||||||
|
22
.github/workflows/_lint.yml
vendored
22
.github/workflows/_lint.yml
vendored
@ -1,4 +1,6 @@
|
|||||||
name: lint
|
name: '🧹 Code Linting'
|
||||||
|
# Runs code quality checks using ruff, mypy, and other linting tools
|
||||||
|
# Checks both package code and test code for consistency
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -24,19 +26,21 @@ env:
|
|||||||
UV_FROZEN: "true"
|
UV_FROZEN: "true"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Linting job - runs quality checks on package and test code
|
||||||
build:
|
build:
|
||||||
name: "make lint #${{ inputs.python-version }}"
|
name: 'Python ${{ inputs.python-version }}'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: '📋 Checkout Code'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Lint & Typing Dependencies'
|
||||||
# Also installs dev/lint/test/typing dependencies, to ensure we have
|
# Also installs dev/lint/test/typing dependencies, to ensure we have
|
||||||
# type hints for as many of our libraries as possible.
|
# type hints for as many of our libraries as possible.
|
||||||
# This helps catch errors that require dependencies to be spotted, for example:
|
# This helps catch errors that require dependencies to be spotted, for example:
|
||||||
@ -49,12 +53,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uv sync --group lint --group typing
|
uv sync --group lint --group typing
|
||||||
|
|
||||||
- name: Analysing the code with our lint
|
- name: '🔍 Analyze Package Code with Linters'
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
make lint_package
|
make lint_package
|
||||||
|
|
||||||
- name: Install unit test dependencies
|
- name: '📦 Install Unit Test Dependencies'
|
||||||
# Also installs dev/lint/test/typing dependencies, to ensure we have
|
# Also installs dev/lint/test/typing dependencies, to ensure we have
|
||||||
# type hints for as many of our libraries as possible.
|
# type hints for as many of our libraries as possible.
|
||||||
# This helps catch errors that require dependencies to be spotted, for example:
|
# This helps catch errors that require dependencies to be spotted, for example:
|
||||||
@ -67,13 +71,13 @@ jobs:
|
|||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
uv sync --inexact --group test
|
uv sync --inexact --group test
|
||||||
- name: Install unit+integration test dependencies
|
- name: '📦 Install Unit + Integration Test Dependencies'
|
||||||
if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }}
|
if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }}
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
uv sync --inexact --group test --group test_integration
|
uv sync --inexact --group test --group test_integration
|
||||||
|
|
||||||
- name: Analysing the code with our lint
|
- name: '🔍 Analyze Test Code with Linters'
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
make lint_tests
|
make lint_tests
|
||||||
|
8
.github/workflows/_release.yml
vendored
8
.github/workflows/_release.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: Release
|
name: '🚀 Package Release'
|
||||||
run-name: Release ${{ inputs.working-directory }} by @${{ github.actor }}
|
run-name: '🚀 Release ${{ inputs.working-directory }} by @${{ github.actor }}'
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
@ -18,7 +18,7 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
description: "Release from a non-master branch (danger!)"
|
description: "Release from a non-master branch (danger!) - Only use for hotfixes"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
@ -26,6 +26,8 @@ env:
|
|||||||
UV_NO_SYNC: "true"
|
UV_NO_SYNC: "true"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Build the distribution package and extract version info
|
||||||
|
# Runs in isolated environment with minimal permissions for security
|
||||||
build:
|
build:
|
||||||
if: github.ref == 'refs/heads/master' || inputs.dangerous-nonmaster-release
|
if: github.ref == 'refs/heads/master' || inputs.dangerous-nonmaster-release
|
||||||
environment: Scheduled testing
|
environment: Scheduled testing
|
||||||
|
22
.github/workflows/_test.yml
vendored
22
.github/workflows/_test.yml
vendored
@ -1,4 +1,6 @@
|
|||||||
name: test
|
name: '🧪 Unit Testing'
|
||||||
|
# Runs unit tests with both current and minimum supported dependency versions
|
||||||
|
# to ensure compatibility across the supported range
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -20,31 +22,33 @@ env:
|
|||||||
UV_NO_SYNC: "true"
|
UV_NO_SYNC: "true"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Main test job - runs unit tests with current deps, then retests with minimum versions
|
||||||
build:
|
build:
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
name: "make test #${{ inputs.python-version }}"
|
name: 'Python ${{ inputs.python-version }}'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: '📋 Checkout Code'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
id: setup-python
|
id: setup-python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
- name: Install dependencies
|
- name: '📦 Install Test Dependencies'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv sync --group test --dev
|
run: uv sync --group test --dev
|
||||||
|
|
||||||
- name: Run core tests
|
- name: '🧪 Run Core Unit Tests'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make test
|
make test
|
||||||
|
|
||||||
- name: Get minimum versions
|
- name: '🔍 Calculate Minimum Dependency Versions'
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
id: min-version
|
id: min-version
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -55,7 +59,7 @@ jobs:
|
|||||||
echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
|
echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
|
||||||
echo "min-versions=$min_versions"
|
echo "min-versions=$min_versions"
|
||||||
|
|
||||||
- name: Run unit tests with minimum dependency versions
|
- name: '🧪 Run Tests with Minimum Dependencies'
|
||||||
if: ${{ steps.min-version.outputs.min-versions != '' }}
|
if: ${{ steps.min-version.outputs.min-versions != '' }}
|
||||||
env:
|
env:
|
||||||
MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }}
|
MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }}
|
||||||
@ -64,7 +68,7 @@ jobs:
|
|||||||
make tests
|
make tests
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
|
||||||
- name: Ensure the tests did not create any additional files
|
- name: '🧹 Verify Clean Working Directory'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
17
.github/workflows/_test_doc_imports.yml
vendored
17
.github/workflows/_test_doc_imports.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: test_doc_imports
|
name: '📑 Documentation Import Testing'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -18,29 +18,30 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
name: "check doc imports #${{ inputs.python-version }}"
|
name: '🔍 Check Doc Imports (Python ${{ inputs.python-version }})'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: '📋 Checkout Code'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Test Dependencies'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv sync --group test
|
run: uv sync --group test
|
||||||
|
|
||||||
- name: Install langchain editable
|
- name: '📦 Install LangChain in Editable Mode'
|
||||||
run: |
|
run: |
|
||||||
VIRTUAL_ENV=.venv uv pip install langchain-experimental langchain-community -e libs/core libs/langchain
|
VIRTUAL_ENV=.venv uv pip install langchain-experimental langchain-community -e libs/core libs/langchain
|
||||||
|
|
||||||
- name: Check doc imports
|
- name: '🔍 Validate Documentation Import Statements'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
uv run python docs/scripts/check_imports.py
|
uv run python docs/scripts/check_imports.py
|
||||||
|
|
||||||
- name: Ensure the test did not create any additional files
|
- name: '🧹 Verify Clean Working Directory'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
17
.github/workflows/_test_pydantic.yml
vendored
17
.github/workflows/_test_pydantic.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: test pydantic intermediate versions
|
name: '🐍 Pydantic Version Testing'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -31,29 +31,30 @@ jobs:
|
|||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
name: "make test # pydantic: ~=${{ inputs.pydantic-version }}, python: ${{ inputs.python-version }}, "
|
name: 'Pydantic ~=${{ inputs.pydantic-version }}'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: '📋 Checkout Code'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Test Dependencies'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv sync --group test
|
run: uv sync --group test
|
||||||
|
|
||||||
- name: Overwrite pydantic version
|
- name: '🔄 Install Specific Pydantic Version'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: VIRTUAL_ENV=.venv uv pip install pydantic~=${{ inputs.pydantic-version }}
|
run: VIRTUAL_ENV=.venv uv pip install pydantic~=${{ inputs.pydantic-version }}
|
||||||
|
|
||||||
- name: Run core tests
|
- name: '🧪 Run Core Tests'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make test
|
make test
|
||||||
|
|
||||||
- name: Ensure the tests did not create any additional files
|
- name: '🧹 Verify Clean Working Directory'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
10
.github/workflows/_test_release.yml
vendored
10
.github/workflows/_test_release.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: test-release
|
name: '🧪 Test Release Package'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -29,7 +29,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python + uv
|
- name: '🐍 Set up Python + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
@ -45,17 +45,17 @@ jobs:
|
|||||||
# > It is strongly advised to separate jobs for building [...]
|
# > It is strongly advised to separate jobs for building [...]
|
||||||
# > from the publish job.
|
# > from the publish job.
|
||||||
# https://github.com/pypa/gh-action-pypi-publish#non-goals
|
# https://github.com/pypa/gh-action-pypi-publish#non-goals
|
||||||
- name: Build project for distribution
|
- name: '📦 Build Project for Distribution'
|
||||||
run: uv build
|
run: uv build
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
|
||||||
- name: Upload build
|
- name: '⬆️ Upload Build Artifacts'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: test-dist
|
name: test-dist
|
||||||
path: ${{ inputs.working-directory }}/dist/
|
path: ${{ inputs.working-directory }}/dist/
|
||||||
|
|
||||||
- name: Check Version
|
- name: '🔍 Extract Version Information'
|
||||||
id: check-version
|
id: check-version
|
||||||
shell: python
|
shell: python
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
24
.github/workflows/api_doc_build.yml
vendored
24
.github/workflows/api_doc_build.yml
vendored
@ -1,13 +1,15 @@
|
|||||||
name: API Docs Build
|
name: '📚 API Documentation Build'
|
||||||
|
# Runs daily or can be triggered manually for immediate updates
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 13 * * *'
|
- cron: '0 13 * * *' # Daily at 1PM UTC
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Only runs on main repository to prevent unnecessary builds on forks
|
||||||
build:
|
build:
|
||||||
if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'
|
if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -23,7 +25,7 @@ jobs:
|
|||||||
path: langchain-api-docs-html
|
path: langchain-api-docs-html
|
||||||
token: ${{ secrets.TOKEN_GITHUB_API_DOCS_HTML }}
|
token: ${{ secrets.TOKEN_GITHUB_API_DOCS_HTML }}
|
||||||
|
|
||||||
- name: Get repos with yq
|
- name: '📋 Extract Repository List with yq'
|
||||||
id: get-unsorted-repos
|
id: get-unsorted-repos
|
||||||
uses: mikefarah/yq@master
|
uses: mikefarah/yq@master
|
||||||
with:
|
with:
|
||||||
@ -42,7 +44,7 @@ jobs:
|
|||||||
| .repo
|
| .repo
|
||||||
' langchain/libs/packages.yml
|
' langchain/libs/packages.yml
|
||||||
|
|
||||||
- name: Parse YAML and checkout repos
|
- name: '📋 Parse YAML & Checkout Repositories'
|
||||||
env:
|
env:
|
||||||
REPOS_UNSORTED: ${{ steps.get-unsorted-repos.outputs.result }}
|
REPOS_UNSORTED: ${{ steps.get-unsorted-repos.outputs.result }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@ -70,39 +72,39 @@ jobs:
|
|||||||
git clone --depth 1 https://github.com/$repo.git $REPO_NAME
|
git clone --depth 1 https://github.com/$repo.git $REPO_NAME
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Setup Python ${{ env.PYTHON_VERSION }}
|
- name: '🐍 Setup Python ${{ env.PYTHON_VERSION }}'
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
id: setup-python
|
id: setup-python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Install initial py deps
|
- name: '📦 Install Initial Python Dependencies'
|
||||||
working-directory: langchain
|
working-directory: langchain
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -U uv
|
python -m pip install -U uv
|
||||||
python -m uv pip install --upgrade --no-cache-dir pip setuptools pyyaml
|
python -m uv pip install --upgrade --no-cache-dir pip setuptools pyyaml
|
||||||
|
|
||||||
- name: Move libs
|
- name: '📦 Organize Library Directories'
|
||||||
run: python langchain/.github/scripts/prep_api_docs_build.py
|
run: python langchain/.github/scripts/prep_api_docs_build.py
|
||||||
|
|
||||||
- name: Rm old html
|
- name: '🧹 Remove Old HTML Files'
|
||||||
run:
|
run:
|
||||||
rm -rf langchain-api-docs-html/api_reference_build/html
|
rm -rf langchain-api-docs-html/api_reference_build/html
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Documentation Dependencies'
|
||||||
working-directory: langchain
|
working-directory: langchain
|
||||||
run: |
|
run: |
|
||||||
python -m uv pip install $(ls ./libs/partners | xargs -I {} echo "./libs/partners/{}") --overrides ./docs/vercel_overrides.txt
|
python -m uv pip install $(ls ./libs/partners | xargs -I {} echo "./libs/partners/{}") --overrides ./docs/vercel_overrides.txt
|
||||||
python -m uv pip install libs/core libs/langchain libs/text-splitters libs/community libs/experimental libs/standard-tests
|
python -m uv pip install libs/core libs/langchain libs/text-splitters libs/community libs/experimental libs/standard-tests
|
||||||
python -m uv pip install -r docs/api_reference/requirements.txt
|
python -m uv pip install -r docs/api_reference/requirements.txt
|
||||||
|
|
||||||
- name: Set Git config
|
- name: '🔧 Configure Git Settings'
|
||||||
working-directory: langchain
|
working-directory: langchain
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "actions@github.com"
|
git config --local user.email "actions@github.com"
|
||||||
git config --local user.name "Github Actions"
|
git config --local user.name "Github Actions"
|
||||||
|
|
||||||
- name: Build docs
|
- name: '📚 Build API Documentation'
|
||||||
working-directory: langchain
|
working-directory: langchain
|
||||||
run: |
|
run: |
|
||||||
python docs/api_reference/create_api_rst.py
|
python docs/api_reference/create_api_rst.py
|
||||||
|
8
.github/workflows/check-broken-links.yml
vendored
8
.github/workflows/check-broken-links.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Check Broken Links
|
name: '🔗 Check Broken Links'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -14,15 +14,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Use Node.js 18.x
|
- name: '🟢 Setup Node.js 18.x'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18.x
|
node-version: 18.x
|
||||||
cache: "yarn"
|
cache: "yarn"
|
||||||
cache-dependency-path: ./docs/yarn.lock
|
cache-dependency-path: ./docs/yarn.lock
|
||||||
- name: Install dependencies
|
- name: '📦 Install Node Dependencies'
|
||||||
run: yarn install --immutable --mode=skip-build
|
run: yarn install --immutable --mode=skip-build
|
||||||
working-directory: ./docs
|
working-directory: ./docs
|
||||||
- name: Check broken links
|
- name: '🔍 Scan Documentation for Broken Links'
|
||||||
run: yarn check-broken-links
|
run: yarn check-broken-links
|
||||||
working-directory: ./docs
|
working-directory: ./docs
|
||||||
|
6
.github/workflows/check_core_versions.yml
vendored
6
.github/workflows/check_core_versions.yml
vendored
@ -1,4 +1,6 @@
|
|||||||
name: Check `core` Version Equality
|
name: '🔍 Check `core` Version Equality'
|
||||||
|
# Ensures version numbers in pyproject.toml and version.py stay in sync
|
||||||
|
# Prevents releases with mismatched version numbers
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -16,7 +18,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check version equality
|
- name: '✅ Verify pyproject.toml & version.py Match'
|
||||||
run: |
|
run: |
|
||||||
PYPROJECT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' libs/core/pyproject.toml)
|
PYPROJECT_VERSION=$(grep -Po '(?<=^version = ")[^"]*' libs/core/pyproject.toml)
|
||||||
VERSION_PY_VERSION=$(grep -Po '(?<=^VERSION = ")[^"]*' libs/core/langchain_core/version.py)
|
VERSION_PY_VERSION=$(grep -Po '(?<=^VERSION = ")[^"]*' libs/core/langchain_core/version.py)
|
||||||
|
42
.github/workflows/check_diffs.yml
vendored
42
.github/workflows/check_diffs.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: CI
|
name: '🔧 CI'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -6,6 +6,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
merge_group:
|
merge_group:
|
||||||
|
|
||||||
|
# Optimizes CI performance by canceling redundant workflow runs
|
||||||
# If another push to the same PR or branch happens while this workflow is still running,
|
# If another push to the same PR or branch happens while this workflow is still running,
|
||||||
# cancel the earlier run in favor of the next run.
|
# cancel the earlier run in favor of the next run.
|
||||||
#
|
#
|
||||||
@ -24,16 +25,23 @@ env:
|
|||||||
UV_NO_SYNC: "true"
|
UV_NO_SYNC: "true"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# This job analyzes which files changed and creates a dynamic test matrix
|
||||||
|
# to only run tests/lints for the affected packages, improving CI efficiency
|
||||||
build:
|
build:
|
||||||
|
name: 'Detect Changes & Set Matrix'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: '📋 Checkout Code'
|
||||||
- uses: actions/setup-python@v5
|
uses: actions/checkout@v4
|
||||||
|
- name: '🐍 Setup Python 3.11'
|
||||||
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
- id: files
|
- name: '📂 Get Changed Files'
|
||||||
|
id: files
|
||||||
uses: Ana06/get-changed-files@v2.3.0
|
uses: Ana06/get-changed-files@v2.3.0
|
||||||
- id: set-matrix
|
- name: '🔍 Analyze Changed Files & Generate Build Matrix'
|
||||||
|
id: set-matrix
|
||||||
run: |
|
run: |
|
||||||
python -m pip install packaging requests
|
python -m pip install packaging requests
|
||||||
python .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
|
python .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
|
||||||
@ -45,8 +53,8 @@ jobs:
|
|||||||
dependencies: ${{ steps.set-matrix.outputs.dependencies }}
|
dependencies: ${{ steps.set-matrix.outputs.dependencies }}
|
||||||
test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}
|
test-doc-imports: ${{ steps.set-matrix.outputs.test-doc-imports }}
|
||||||
test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}
|
test-pydantic: ${{ steps.set-matrix.outputs.test-pydantic }}
|
||||||
|
# Run linting only on packages that have changed files
|
||||||
lint:
|
lint:
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
if: ${{ needs.build.outputs.lint != '[]' }}
|
if: ${{ needs.build.outputs.lint != '[]' }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -59,8 +67,8 @@ jobs:
|
|||||||
python-version: ${{ matrix.job-configs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
# Run unit tests only on packages that have changed files
|
||||||
test:
|
test:
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
if: ${{ needs.build.outputs.test != '[]' }}
|
if: ${{ needs.build.outputs.test != '[]' }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -73,8 +81,8 @@ jobs:
|
|||||||
python-version: ${{ matrix.job-configs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
# Test compatibility with different Pydantic versions for affected packages
|
||||||
test-pydantic:
|
test-pydantic:
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
if: ${{ needs.build.outputs.test-pydantic != '[]' }}
|
if: ${{ needs.build.outputs.test-pydantic != '[]' }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -95,12 +103,12 @@ jobs:
|
|||||||
job-configs: ${{ fromJson(needs.build.outputs.test-doc-imports) }}
|
job-configs: ${{ fromJson(needs.build.outputs.test-doc-imports) }}
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
uses: ./.github/workflows/_test_doc_imports.yml
|
uses: ./.github/workflows/_test_doc_imports.yml
|
||||||
secrets: inherit
|
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.job-configs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
|
# Verify integration tests compile without actually running them (faster feedback)
|
||||||
compile-integration-tests:
|
compile-integration-tests:
|
||||||
name: cd ${{ matrix.job-configs.working-directory }}
|
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
if: ${{ needs.build.outputs.compile-integration-tests != '[]' }}
|
if: ${{ needs.build.outputs.compile-integration-tests != '[]' }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -113,8 +121,9 @@ jobs:
|
|||||||
python-version: ${{ matrix.job-configs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
# Run extended test suites that require additional dependencies
|
||||||
extended-tests:
|
extended-tests:
|
||||||
name: "cd ${{ matrix.job-configs.working-directory }} / make extended_tests #${{ matrix.job-configs.python-version }}"
|
name: 'Extended Tests'
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
if: ${{ needs.build.outputs.extended-tests != '[]' }}
|
if: ${{ needs.build.outputs.extended-tests != '[]' }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -130,12 +139,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.job-configs.python-version }} + uv
|
- name: '🐍 Set up Python ${{ matrix.job-configs.python-version }} + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.job-configs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies and run extended tests
|
- name: '📦 Install Dependencies & Run Extended Tests'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Running extended tests, installing dependencies with uv..."
|
echo "Running extended tests, installing dependencies with uv..."
|
||||||
@ -144,7 +153,7 @@ jobs:
|
|||||||
VIRTUAL_ENV=.venv uv pip install -r extended_testing_deps.txt
|
VIRTUAL_ENV=.venv uv pip install -r extended_testing_deps.txt
|
||||||
VIRTUAL_ENV=.venv make extended_tests
|
VIRTUAL_ENV=.venv make extended_tests
|
||||||
|
|
||||||
- name: Ensure the tests did not create any additional files
|
- name: '🧹 Verify Clean Working Directory'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
@ -156,8 +165,9 @@ jobs:
|
|||||||
# and `set -e` above will cause the step to fail.
|
# and `set -e` above will cause the step to fail.
|
||||||
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|
||||||
|
|
||||||
|
# Final status check - ensures all required jobs passed before allowing merge
|
||||||
ci_success:
|
ci_success:
|
||||||
name: "CI Success"
|
name: '✅ CI Success'
|
||||||
needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]
|
needs: [build, lint, test, compile-integration-tests, extended-tests, test-doc-imports, test-pydantic]
|
||||||
if: |
|
if: |
|
||||||
always()
|
always()
|
||||||
@ -167,7 +177,7 @@ jobs:
|
|||||||
RESULTS_JSON: ${{ toJSON(needs.*.result) }}
|
RESULTS_JSON: ${{ toJSON(needs.*.result) }}
|
||||||
EXIT_CODE: ${{!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && '0' || '1'}}
|
EXIT_CODE: ${{!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && '0' || '1'}}
|
||||||
steps:
|
steps:
|
||||||
- name: "CI Success"
|
- name: '🎉 All Checks Passed'
|
||||||
run: |
|
run: |
|
||||||
echo $JOBS_JSON
|
echo $JOBS_JSON
|
||||||
echo $RESULTS_JSON
|
echo $RESULTS_JSON
|
||||||
|
4
.github/workflows/check_new_docs.yml
vendored
4
.github/workflows/check_new_docs.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Integration Docs Lint
|
name: '📑 Integration Docs Lint'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -33,6 +33,6 @@ jobs:
|
|||||||
*.ipynb
|
*.ipynb
|
||||||
*.md
|
*.md
|
||||||
*.mdx
|
*.mdx
|
||||||
- name: Check new docs
|
- name: '🔍 Check New Documentation Templates'
|
||||||
run: |
|
run: |
|
||||||
python docs/scripts/check_templates.py ${{ steps.files.outputs.added }}
|
python docs/scripts/check_templates.py ${{ steps.files.outputs.added }}
|
||||||
|
35
.github/workflows/codespell.yml
vendored
35
.github/workflows/codespell.yml
vendored
@ -1,35 +0,0 @@
|
|||||||
name: CI / cd . / make spell_check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master, v0.1, v0.2]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
codespell:
|
|
||||||
name: (Check for spelling errors)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: |
|
|
||||||
pip install toml
|
|
||||||
|
|
||||||
- name: Extract Ignore Words List
|
|
||||||
run: |
|
|
||||||
# Use a Python script to extract the ignore words list from pyproject.toml
|
|
||||||
python .github/workflows/extract_ignored_words_list.py
|
|
||||||
id: extract_ignore_words
|
|
||||||
|
|
||||||
# - name: Codespell
|
|
||||||
# uses: codespell-project/actions-codespell@v2
|
|
||||||
# with:
|
|
||||||
# skip: guide_imports.json,*.ambr,./cookbook/data/imdb_top_1000.csv,*.lock
|
|
||||||
# ignore_words_list: ${{ steps.extract_ignore_words.outputs.ignore_words_list }}
|
|
||||||
# exclude_file: ./.github/workflows/codespell-exclude
|
|
10
.github/workflows/codspeed.yml
vendored
10
.github/workflows/codspeed.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: CodSpeed
|
name: '⚡ CodSpeed'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -18,7 +18,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
codspeed:
|
codspeed:
|
||||||
name: Run benchmarks
|
name: 'Benchmark'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# We have to use 3.12 as 3.13 is not yet supported
|
# We have to use 3.12 as 3.13 is not yet supported
|
||||||
- name: Install uv
|
- name: '📦 Install UV Package Manager'
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
@ -47,11 +47,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Test Dependencies'
|
||||||
run: uv sync --group test
|
run: uv sync --group test
|
||||||
working-directory: ${{ matrix.working-directory }}
|
working-directory: ${{ matrix.working-directory }}
|
||||||
|
|
||||||
- name: Run benchmarks ${{ matrix.working-directory }}
|
- name: '⚡ Run Benchmarks: ${{ matrix.working-directory }}'
|
||||||
uses: CodSpeedHQ/action@v3
|
uses: CodSpeedHQ/action@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODSPEED_TOKEN }}
|
token: ${{ secrets.CODSPEED_TOKEN }}
|
||||||
|
6
.github/workflows/people.yml
vendored
6
.github/workflows/people.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: LangChain People
|
name: '👥 LangChain People'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@ -14,13 +14,13 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: '📋 Dump GitHub Context'
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
run: echo "$GITHUB_CONTEXT"
|
run: echo "$GITHUB_CONTEXT"
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# Ref: https://github.com/actions/runner/issues/2033
|
# Ref: https://github.com/actions/runner/issues/2033
|
||||||
- name: Fix git safe.directory in container
|
- name: '🔧 Fix Git Safe Directory in Container'
|
||||||
run: mkdir -p /home/runner/work/_temp/_github_home && printf "[safe]\n\tdirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig
|
run: mkdir -p /home/runner/work/_temp/_github_home && printf "[safe]\n\tdirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig
|
||||||
- uses: ./.github/actions/people
|
- uses: ./.github/actions/people
|
||||||
with:
|
with:
|
||||||
|
8
.github/workflows/pr_lint.yml
vendored
8
.github/workflows/pr_lint.yml
vendored
@ -4,6 +4,7 @@
|
|||||||
# Purpose:
|
# Purpose:
|
||||||
# Enforces Conventional Commits format for pull request titles to maintain a
|
# Enforces Conventional Commits format for pull request titles to maintain a
|
||||||
# clear, consistent, and machine-readable change history across our repository.
|
# clear, consistent, and machine-readable change history across our repository.
|
||||||
|
# This helps with automated changelog generation and semantic versioning.
|
||||||
#
|
#
|
||||||
# Enforced Commit Message Format (Conventional Commits 1.0.0):
|
# Enforced Commit Message Format (Conventional Commits 1.0.0):
|
||||||
# <type>[optional scope]: <description>
|
# <type>[optional scope]: <description>
|
||||||
@ -45,7 +46,7 @@
|
|||||||
# • Conventional Commits spec: https://www.conventionalcommits.org/en/v1.0.0/
|
# • Conventional Commits spec: https://www.conventionalcommits.org/en/v1.0.0/
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
name: PR Title Lint
|
name: '🏷️ PR Title Lint'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: read
|
pull-requests: read
|
||||||
@ -55,11 +56,12 @@ on:
|
|||||||
types: [opened, edited, synchronize]
|
types: [opened, edited, synchronize]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Validates that PR title follows Conventional Commits specification
|
||||||
lint-pr-title:
|
lint-pr-title:
|
||||||
name: Validate PR Title
|
name: 'Validate PR Title Format'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Validate PR Title
|
- name: '✅ Validate Conventional Commits Format'
|
||||||
uses: amannn/action-semantic-pull-request@v5
|
uses: amannn/action-semantic-pull-request@v5
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
18
.github/workflows/run_notebooks.yml
vendored
18
.github/workflows/run_notebooks.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Run Notebooks
|
name: '📝 Run Documentation Notebooks'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -24,43 +24,43 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'
|
if: github.repository == 'langchain-ai/langchain' || github.event_name != 'schedule'
|
||||||
name: "Test docs"
|
name: '📑 Test Documentation Notebooks'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python + uv
|
- name: '🐍 Set up Python + UV'
|
||||||
uses: "./.github/actions/uv_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ github.event.inputs.python_version || '3.11' }}
|
python-version: ${{ github.event.inputs.python_version || '3.11' }}
|
||||||
|
|
||||||
- name: 'Authenticate to Google Cloud'
|
- name: '🔐 Authenticate to Google Cloud'
|
||||||
id: 'auth'
|
id: 'auth'
|
||||||
uses: google-github-actions/auth@v2
|
uses: google-github-actions/auth@v2
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
|
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
|
||||||
|
|
||||||
- name: Configure AWS Credentials
|
- name: '🔐 Configure AWS Credentials'
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: '📦 Install Dependencies'
|
||||||
run: |
|
run: |
|
||||||
uv sync --group dev --group test
|
uv sync --group dev --group test
|
||||||
|
|
||||||
- name: Pre-download files
|
- name: '📦 Pre-download Test Files'
|
||||||
run: |
|
run: |
|
||||||
uv run python docs/scripts/cache_data.py
|
uv run python docs/scripts/cache_data.py
|
||||||
curl -s https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql | sqlite3 docs/docs/how_to/Chinook.db
|
curl -s https://raw.githubusercontent.com/lerocha/chinook-database/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql | sqlite3 docs/docs/how_to/Chinook.db
|
||||||
cp docs/docs/how_to/Chinook.db docs/docs/tutorials/Chinook.db
|
cp docs/docs/how_to/Chinook.db docs/docs/tutorials/Chinook.db
|
||||||
|
|
||||||
- name: Prepare notebooks
|
- name: '🔧 Prepare Notebooks for CI'
|
||||||
run: |
|
run: |
|
||||||
uv run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory ${{ github.event.inputs.working-directory || 'all' }}
|
uv run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory ${{ github.event.inputs.working-directory || 'all' }}
|
||||||
|
|
||||||
- name: Run notebooks
|
- name: '🚀 Execute Notebooks'
|
||||||
env:
|
env:
|
||||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
|
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
|
||||||
|
37
.github/workflows/scheduled_test.yml
vendored
37
.github/workflows/scheduled_test.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
name: Scheduled Tests
|
name: '⏰ Scheduled Integration Tests'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
|
workflow_dispatch: # Allows maintainers to trigger the workflow manually in GitHub UI
|
||||||
inputs:
|
inputs:
|
||||||
working-directory-force:
|
working-directory-force:
|
||||||
type: string
|
type: string
|
||||||
@ -10,7 +10,7 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: "Python version to use - defaults to 3.9 and 3.11 in matrix - example value: 3.9"
|
description: "Python version to use - defaults to 3.9 and 3.11 in matrix - example value: 3.9"
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 13 * * *'
|
- cron: '0 13 * * *' # Runs daily at 1PM UTC (9AM EDT/6AM PDT)
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -22,14 +22,16 @@ env:
|
|||||||
POETRY_LIBS: ("libs/partners/google-vertexai" "libs/partners/google-genai" "libs/partners/aws")
|
POETRY_LIBS: ("libs/partners/google-vertexai" "libs/partners/google-genai" "libs/partners/aws")
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Generate dynamic test matrix based on input parameters or defaults
|
||||||
|
# Only runs on the main repo (for scheduled runs) or when manually triggered
|
||||||
compute-matrix:
|
compute-matrix:
|
||||||
if: github.repository_owner == 'langchain-ai' || github.event_name != 'schedule'
|
if: github.repository_owner == 'langchain-ai' || github.event_name != 'schedule'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Compute matrix
|
name: '📋 Compute Test Matrix'
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- name: Set matrix
|
- name: '🔢 Generate Python & Library Matrix'
|
||||||
id: set-matrix
|
id: set-matrix
|
||||||
env:
|
env:
|
||||||
DEFAULT_LIBS: ${{ env.DEFAULT_LIBS }}
|
DEFAULT_LIBS: ${{ env.DEFAULT_LIBS }}
|
||||||
@ -50,9 +52,11 @@ jobs:
|
|||||||
matrix="{\"python-version\": $python_version, \"working-directory\": $working_directory}"
|
matrix="{\"python-version\": $python_version, \"working-directory\": $working_directory}"
|
||||||
echo $matrix
|
echo $matrix
|
||||||
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
echo "matrix=$matrix" >> $GITHUB_OUTPUT
|
||||||
|
# Run integration tests against partner libraries with live API credentials
|
||||||
|
# Tests are run with both Poetry and UV depending on the library's setup
|
||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'langchain-ai' || github.event_name != 'schedule'
|
if: github.repository_owner == 'langchain-ai' || github.event_name != 'schedule'
|
||||||
name: Python ${{ matrix.python-version }} - ${{ matrix.working-directory }}
|
name: '🐍 Python ${{ matrix.python-version }}: ${{ matrix.working-directory }}'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [compute-matrix]
|
needs: [compute-matrix]
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
@ -75,7 +79,7 @@ jobs:
|
|||||||
repository: langchain-ai/langchain-aws
|
repository: langchain-ai/langchain-aws
|
||||||
path: langchain-aws
|
path: langchain-aws
|
||||||
|
|
||||||
- name: Move libs
|
- name: '📦 Organize External Libraries'
|
||||||
run: |
|
run: |
|
||||||
rm -rf \
|
rm -rf \
|
||||||
langchain/libs/partners/google-genai \
|
langchain/libs/partners/google-genai \
|
||||||
@ -84,7 +88,7 @@ jobs:
|
|||||||
mv langchain-google/libs/vertexai langchain/libs/partners/google-vertexai
|
mv langchain-google/libs/vertexai langchain/libs/partners/google-vertexai
|
||||||
mv langchain-aws/libs/aws langchain/libs/partners/aws
|
mv langchain-aws/libs/aws langchain/libs/partners/aws
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }} with poetry
|
- name: '🐍 Set up Python ${{ matrix.python-version }} + Poetry'
|
||||||
if: contains(env.POETRY_LIBS, matrix.working-directory)
|
if: contains(env.POETRY_LIBS, matrix.working-directory)
|
||||||
uses: "./langchain/.github/actions/poetry_setup"
|
uses: "./langchain/.github/actions/poetry_setup"
|
||||||
with:
|
with:
|
||||||
@ -93,40 +97,40 @@ jobs:
|
|||||||
working-directory: langchain/${{ matrix.working-directory }}
|
working-directory: langchain/${{ matrix.working-directory }}
|
||||||
cache-key: scheduled
|
cache-key: scheduled
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }} + uv
|
- name: '🐍 Set up Python ${{ matrix.python-version }} + UV'
|
||||||
if: "!contains(env.POETRY_LIBS, matrix.working-directory)"
|
if: "!contains(env.POETRY_LIBS, matrix.working-directory)"
|
||||||
uses: "./langchain/.github/actions/uv_setup"
|
uses: "./langchain/.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: 'Authenticate to Google Cloud'
|
- name: '🔐 Authenticate to Google Cloud'
|
||||||
id: 'auth'
|
id: 'auth'
|
||||||
uses: google-github-actions/auth@v2
|
uses: google-github-actions/auth@v2
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
|
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
|
||||||
|
|
||||||
- name: Configure AWS Credentials
|
- name: '🔐 Configure AWS Credentials'
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: ${{ secrets.AWS_REGION }}
|
aws-region: ${{ secrets.AWS_REGION }}
|
||||||
|
|
||||||
- name: Install dependencies (poetry)
|
- name: '📦 Install Dependencies (Poetry)'
|
||||||
if: contains(env.POETRY_LIBS, matrix.working-directory)
|
if: contains(env.POETRY_LIBS, matrix.working-directory)
|
||||||
run: |
|
run: |
|
||||||
echo "Running scheduled tests, installing dependencies with poetry..."
|
echo "Running scheduled tests, installing dependencies with poetry..."
|
||||||
cd langchain/${{ matrix.working-directory }}
|
cd langchain/${{ matrix.working-directory }}
|
||||||
poetry install --with=test_integration,test
|
poetry install --with=test_integration,test
|
||||||
|
|
||||||
- name: Install dependencies (uv)
|
- name: '📦 Install Dependencies (UV)'
|
||||||
if: "!contains(env.POETRY_LIBS, matrix.working-directory)"
|
if: "!contains(env.POETRY_LIBS, matrix.working-directory)"
|
||||||
run: |
|
run: |
|
||||||
echo "Running scheduled tests, installing dependencies with uv..."
|
echo "Running scheduled tests, installing dependencies with uv..."
|
||||||
cd langchain/${{ matrix.working-directory }}
|
cd langchain/${{ matrix.working-directory }}
|
||||||
uv sync --group test --group test_integration
|
uv sync --group test --group test_integration
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: '🚀 Run Integration Tests'
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
@ -155,14 +159,15 @@ jobs:
|
|||||||
cd langchain/${{ matrix.working-directory }}
|
cd langchain/${{ matrix.working-directory }}
|
||||||
make integration_tests
|
make integration_tests
|
||||||
|
|
||||||
- name: Remove external libraries
|
- name: '🧹 Clean up External Libraries'
|
||||||
|
# Clean up external libraries to avoid affecting git status check
|
||||||
run: |
|
run: |
|
||||||
rm -rf \
|
rm -rf \
|
||||||
langchain/libs/partners/google-genai \
|
langchain/libs/partners/google-genai \
|
||||||
langchain/libs/partners/google-vertexai \
|
langchain/libs/partners/google-vertexai \
|
||||||
langchain/libs/partners/aws
|
langchain/libs/partners/aws
|
||||||
|
|
||||||
- name: Ensure tests did not create additional files
|
- name: '🧹 Verify Clean Working Directory'
|
||||||
working-directory: langchain
|
working-directory: langchain
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
Loading…
Reference in New Issue
Block a user