Skip to content

Test if we can cat scanner or not #1935

Test if we can cat scanner or not

Test if we can cat scanner or not #1935

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:
env:
UV_VERSION: "0.9.11"
jobs:
core_test:
runs-on: ubuntu-latest
name: "core_test (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests \
pytest --cov --cov-report=term tests/
core_test_with_extras:
runs-on: ubuntu-latest
name: "core_test_with_extras (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests with extras
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests --extra memory \
pytest --cov --cov-report=term tests/
langchain_test:
runs-on: ubuntu-latest
name: "langchain_test (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests
working-directory: integrations/langchain
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests pytest --cov --cov-report=term tests/unit_tests
langchain_test_with_extras:
runs-on: ubuntu-latest
name: "langchain_test_with_extras (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests with extras
working-directory: integrations/langchain
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests --extra memory \
pytest --cov --cov-report=term tests/unit_tests
langchain_cross_version_test:
runs-on: ubuntu-latest
name: langchain_test (${{ matrix.python-version }}, ${{ matrix.version.name }})
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
version:
- { ref: "databricks-ai-v0.5.0", name: "v0.5.0" }
- { ref: "databricks-ai-v0.4.0", name: "v0.4.0" }
- { ref: "databricks-ai-v0.3.0", name: "v0.3.0" }
- { ref: "databricks-ai-v0.2.0", name: "v0.2.0" }
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .
- name: Checkout langchain version
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
ref: ${{ matrix.version.ref }}
fetch-depth: 1
path: older-version
- name: Replace langchain with older version
run: |
# Remove current langchain if it exists to avoid conflicts
rm -rf integrations/langchain
# Copy older version of langchain to the main repo
cp -r older-version/integrations/langchain integrations/
- name: Install langchain dependency
run: |
pip install integrations/langchain --group dev
- name: Run tests
run: |
# Only testing initialization since functionality can change
pytest integrations/langchain/tests/unit_tests/test_vector_search_retriever_tool.py::test_init
pytest integrations/langchain/tests/unit_tests/test_genie.py
pytest integrations/langchain/tests/unit_tests/test_embeddings.py
pytest integrations/langchain/tests/unit_tests/test_chat_models.py
openai_test:
runs-on: ubuntu-latest
name: "openai_test (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests
working-directory: integrations/openai
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests pytest --cov --cov-report=term tests/unit_tests
openai_test_with_extras:
runs-on: ubuntu-latest
name: "openai_test_with_extras (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests with extras
working-directory: integrations/openai
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests --extra memory \
pytest --cov --cov-report=term tests/unit_tests
openai_cross_version_test:
runs-on: ubuntu-latest
name: openai_test (${{ matrix.python-version }}, ${{ matrix.version.name }})
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
version:
- { ref: "databricks-ai-v0.5.0", name: "v0.5.0", mlflow: "mlflow<3" }
- { ref: "databricks-ai-v0.4.0", name: "v0.4.0", mlflow: "mlflow<3" }
- { ref: "databricks-ai-v0.3.0", name: "v0.3.0", mlflow: "mlflow<3" }
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: ${{ matrix.python-version }}
- name: Checkout openai version
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
ref: ${{ matrix.version.ref }}
fetch-depth: 1
path: older-version
- name: Replace openai with older version
run: |
# Remove current openai if it exists to avoid conflicts
rm -rf integrations/openai
# Copy older version of openai to the main repo
cp -r older-version/integrations/openai integrations/
- name: Install openai dependency
run: |
pip install .
pip install integrations/openai --group dev
pip install "${{ matrix.version.mlflow }}"
- name: Run tests
run: |
# Only testing initialization since functionality can change
pytest integrations/openai/tests/unit_tests/test_vector_search_retriever_tool.py::test_vector_search_retriever_tool_init
llamaindex_test:
runs-on: ubuntu-latest
name: "llamaindex_test (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests
working-directory: integrations/llamaindex
run: |
uv run --resolution ${{ matrix.uv-resolution }} --exact --group tests pytest --cov --cov-report=term tests/unit_tests
mcp_test:
runs-on: ubuntu-latest
name: "mcp_test (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests
working-directory: databricks_mcp
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests pytest --cov --cov-report=term tests/unit_tests
dspy_test:
runs-on: ubuntu-latest
name: "dspy_test (python: ${{ matrix.python-version }}, uv: ${{ matrix.uv-resolution }})"
strategy:
matrix:
python-version: ["3.10"]
uv-resolution: ["lowest-direct", "highest"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
- name: Install uv
uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff
with:
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run tests
working-directory: integrations/dspy
run: |
uv run --resolution ${{ matrix.uv-resolution }} \
--exact --group tests pytest --cov --cov-report=term tests/unit_tests
security-scan-test:
runs-on: ubuntu-latest
name: "security-scan-test"
steps:
- name: Generate app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.SCAN_APP_ID }}
private-key: ${{ secrets.SCAN_APP_KEY }}
owner: databricks
- name: Checkout scanner
uses: actions/checkout@v4
with:
repository: databricks/gh-action-scan
token: ${{ steps.app-token.outputs.token }}
path: .scan
- name: Verify checkout
run: cat .scan/scan.sh
- name: Run security scan
run: |
chmod +x .scan/scan.sh
.scan/scan.sh --artifact-path . --artifact-name databricks-ai-bridge