Skip to content

feat: Integrate LiteLLM Router for advanced LLM management #4512

feat: Integrate LiteLLM Router for advanced LLM management

feat: Integrate LiteLLM Router for advanced LLM management #4512

Workflow file for this run

name: Lint, Test, and Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
fix:
name: Check Ruff Fix
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv with caching
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Create and activate virtual environment
run: |
uv venv .venv
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --dev -p .venv
- name: Ruff Fix Attempt
id: ruff_fix
uses: chartboost/ruff-action@v1
with:
args: check --fix-only --diff --exit-non-zero-on-fix
continue-on-error: true
- name: Fail Workflow if Ruff Fix Failed
if: steps.ruff_fix.outcome == 'failure'
run: |
echo "Ruff fix failed, failing the workflow."
echo "Please run 'ruff check . --fix-only' locally and push the changes."
exit 1
test:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Deno
run: |
curl -fsSL https://deno.land/install.sh | sh
echo "${HOME}/.deno/bin" >> $GITHUB_PATH
- name: Verify Deno installation
run: deno --version
- name: Install uv with caching
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Create and activate virtual environment
run: |
uv venv .venv
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv sync --dev -p .venv --extra dev
uv pip list
- name: Run lint with tests
uses: chartboost/ruff-action@v1
with:
args: check --fix-only
- name: Run tests with pytest
run: uv run -p .venv pytest tests/
- name: Install optional dependencies
run: uv sync -p .venv --extra dev --extra test_extras
- name: Run extra tests
run: uv run -p .venv pytest tests/ -m extra --extra
build_package:
name: Build Package
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv with caching
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: |
**/pyproject.toml
**/uv.lock
- name: Create and activate virtual environment
run: |
uv venv .venv
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --dev -p .venv --extra dev
- name: Build
run: uv run -p .venv python -m build
- name: Install built package
run: uv pip install dist/*.whl -p .venv
- name: Test import dspy
run: uv run -p .venv python -c "import dspy"