mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-25 14:35:49 +00:00
Especially helpful for the text splitters tests where we're installing
pytorch (expensive and slow slow slow). Should speed up CI by 5-10 mins.
w/o caches, CI taking 20 minutes 😨
w/ caches, CI taking 3 minutes
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: '📑 Documentation Import Testing'
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
python-version:
|
|
required: true
|
|
type: string
|
|
description: "Python version to use"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
UV_FROZEN: "true"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
name: '🔍 Check Doc Imports (Python ${{ inputs.python-version }})'
|
|
steps:
|
|
- name: '📋 Checkout Code'
|
|
uses: actions/checkout@v5
|
|
|
|
- name: '🐍 Set up Python ${{ inputs.python-version }} + UV'
|
|
uses: "./.github/actions/uv_setup"
|
|
with:
|
|
python-version: ${{ inputs.python-version }}
|
|
cache-suffix: test-doc-imports-${{ inputs.working-directory }}
|
|
working-directory: ${{ inputs.working-directory }}
|
|
|
|
- name: '📦 Install Test Dependencies'
|
|
shell: bash
|
|
run: uv sync --group test
|
|
|
|
- name: '📦 Install LangChain in Editable Mode'
|
|
run: |
|
|
VIRTUAL_ENV=.venv uv pip install langchain-experimental langchain-community -e libs/core libs/langchain
|
|
|
|
- name: '🔍 Validate Documentation Import Statements'
|
|
shell: bash
|
|
run: |
|
|
uv run python docs/scripts/check_imports.py
|
|
|
|
- name: '🧹 Verify Clean Working Directory'
|
|
shell: bash
|
|
run: |
|
|
set -eu
|
|
|
|
STATUS="$(git status)"
|
|
echo "$STATUS"
|
|
|
|
# grep will exit non-zero if the target message isn't found,
|
|
# and `set -e` above will cause the step to fail.
|
|
echo "$STATUS" | grep 'nothing to commit, working tree clean'
|