Files
LangBot/.github/workflows/plugins-knowledgeengine-shared-tests.yml
huanghuoguoguo 1f227f7aa8 ci: scope PR checks and run the complete matrix daily (#3056)
* ci: streamline pull request checks and run the full matrix daily

Refs #3055

* ci: run runtime contracts only on affected Core checks

* test(ci): distinguish SDK checks from SDK publication

* fix(ci): retain legacy regressions and scope production image builds

* docs(ci): clarify focused regressions and production image selection
2026-11-17 17:31:50 +08:00

91 lines
4.3 KiB
YAML

name: Plugins / KnowledgeEngine shared SDK verification
on:
pull_request:
paths:
- "sdk/**"
- "src/langbot/pkg/api/application/**"
- "src/langbot/pkg/core/stages/**"
- "src/langbot/pkg/entity/**"
- "src/langbot/pkg/plugin/**"
- "src/langbot/pkg/workspace/**"
- "scripts/generate_plugin_workspace_api.py"
- "pyproject.toml"
- "uv.lock"
- "src/langbot/pkg/rag/**"
- "src/langbot/pkg/vector/**"
- ".github/workflows/plugins-langrag-tests.yml"
- "plugins/pytest.ini"
- 'plugins/KnowledgeEngine/**'
- '.github/workflows/plugins-knowledgeengine-shared-tests.yml'
workflow_dispatch:
workflow_call:
permissions:
contents: read
concurrency:
group: knowledgeengine-shared-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
candidate-sdk:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
RELEASED_SDK_WHEEL: 'https://files.pythonhosted.org/packages/f2/c7/c870377771cbe27e047b19778b5f249b15efef52409358901af94d13e6c0/langbot_plugin-0.7.4-py3-none-any.whl#sha256=596ecd776c13efa6f6cfe178463dc4a967653238548c9569195cdbb5aa47506e'
defaults:
run:
working-directory: plugins
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: astral-sh/setup-uv@v5
- name: Install released SDK and test dependencies
run: |
uv venv
uv pip install "$RELEASED_SDK_WHEEL" pytest pytest-asyncio \
-r KnowledgeEngine/LangRAG/requirements.txt \
-r KnowledgeEngine/DifyDatasetsConnector/requirements.txt \
-r KnowledgeEngine/FastGPTConnector/requirements.txt \
-r KnowledgeEngine/RAGFlowConnector/requirements.txt
.venv/bin/python -c 'from importlib.metadata import version; assert version("langbot-plugin") == "0.7.4"'
- name: Behavioral regressions (fake Host and HTTP provider)
run: .venv/bin/python -m pytest KnowledgeEngine/certification-tests -q
- name: Install LangRAG released SDK in isolation
run: |
uv venv "$RUNNER_TEMP/langrag-released"
uv pip install --python "$RUNNER_TEMP/langrag-released/bin/python" \
"$RELEASED_SDK_WHEEL" -r KnowledgeEngine/LangRAG/requirements.txt
- name: LangRAG released SDK import smoke
working-directory: plugins/KnowledgeEngine/LangRAG
run: |
"$RUNNER_TEMP/langrag-released/bin/python" -c "import langbot_plugin; from main import LangRAG; from components.knowledge_engine.langrag import LangRAG as Engine; from components.pages.observability import LangRAGObservabilityPage; print('Released SDK:', langbot_plugin.__file__); print(LangRAG.__name__, Engine.__name__, LangRAGObservabilityPage.__name__)"
- name: LangRAG legacy unit and benchmark fixtures
working-directory: plugins/KnowledgeEngine/LangRAG
run: '"$RUNNER_TEMP/langrag-released/bin/python" -m unittest discover -s tests -v'
- name: LongTermMemory regressions
working-directory: plugins/KnowledgeEngine/LongTermMemory
run: PYTHONPATH=. ../../.venv/bin/python -m pytest tests -q
- name: Exact archives, real dependency prepare, discovery and RPC
run: .venv/bin/python KnowledgeEngine/certification-tests/verify_candidates.py --evidence "$RUNNER_TEMP/ke-evidence"
- name: Test KnowledgeEngine consumers with the in-tree SDK
run: |
uv pip install ../sdk
uv pip check
.venv/bin/python -c 'import json; from importlib.metadata import distribution; from pathlib import Path; sdk = distribution("langbot-plugin"); origin = json.loads(sdk.read_text("direct_url.json"))["url"]; assert origin == Path("../sdk").resolve().as_uri(), origin; print(sdk.version, origin)'
.venv/bin/python -m pytest KnowledgeEngine/certification-tests -q
- name: Retain unsigned candidate evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: knowledgeengine-unsigned-candidates
path: |
${{ runner.temp }}/ke-evidence/*.json
${{ runner.temp }}/ke-evidence/*.log
${{ runner.temp }}/ke-evidence/packages/**/*.lbpkg