DRAFT: updated graph_store to store graph in metadata columns #1324
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - RAGStack tests | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ragstack-tests-${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
preconditions: | |
name: Preconditions | |
runs-on: ubuntu-latest | |
outputs: | |
docker_examples: ${{ steps.filter.outputs.docker_examples }} | |
libs_colbert: ${{ steps.filter.outputs.libs_colbert }} | |
libs_langchain: ${{ steps.filter.outputs.libs_langchain }} | |
libs_llamaindex: ${{ steps.filter.outputs.libs_llamaindex }} | |
libs_knowledge_store: ${{ steps.filter.outputs.libs_knowledge_store }} | |
libs_knowledge_graph: ${{ steps.filter.outputs.libs_knowledge_graph }} | |
libs_ragulate: ${{ steps.filter.outputs.libs_ragulate }} | |
integration_tests: ${{ steps.filter.outputs.integration_tests }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: ./.github/changes-filter.yaml | |
build-docker: | |
name: Docker | |
runs-on: ubuntu-latest | |
needs: ["preconditions"] | |
if: ${{ needs.preconditions.outputs.docker_examples == 'true' }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Docker examples - basic | |
run: | | |
docker --version | |
cd docker/examples/basic | |
sudo docker build -t ragstack-basic . | |
- name: Docker examples - multistage | |
run: | | |
cd docker/examples/multistage | |
sudo docker build -t ragstack-multistage . | |
- name: Docker examples - local llm | |
run: | | |
cd docker/examples/local-llm | |
sudo docker build -t local-llm . | |
lint: | |
name: Lint (Python ${{ matrix.python-version }}) | |
needs: ["preconditions"] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.12" | |
- "3.11" | |
- "3.10" | |
- "3.9" | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: "Setup: Python ${{ matrix.python-version }}" | |
uses: ./.github/actions/setup-python | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: Run lint | |
uses: ./.github/actions/lint | |
type-check: | |
name: Type Check | |
needs: ["preconditions"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: "Setup: Python 3.11" | |
uses: ./.github/actions/setup-python | |
- name: "Type check (colbert)" | |
run: tox -e type -c libs/colbert && rm -rf libs/colbert/.tox | |
- name: "Type check (knowledge-graph)" | |
run: tox -e type -c libs/knowledge-graph && rm -rf libs/knowledge-graph/.tox | |
- name: "Type check (knowledge-store)" | |
run: tox -e type -c libs/knowledge-store && rm -rf libs/knowledge-store/.tox | |
- name: "Type check (langchain)" | |
run: tox -e type -c libs/langchain && rm -rf libs/langchain/.tox | |
- name: "Type check (llama-index)" | |
run: tox -e type -c libs/llamaindex && rm -rf libs/llamaindex/.tox | |
- name: "Type check (ragulate)" | |
run: tox -e type -c libs/ragulate && rm -rf libs/ragulate/.tox | |
- name: "Type check (test-utils)" | |
run: tox -e type -c libs/tests-utils && rm -rf libs/tests-utils/.tox | |
unit-tests: | |
name: Unit Tests (Python ${{ matrix.python-version }}) | |
needs: ["preconditions"] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.12" | |
- "3.11" | |
- "3.10" | |
- "3.9" | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: "Setup: Python ${{ matrix.python-version }}" | |
uses: ./.github/actions/setup-python | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: "Unit tests (root)" | |
# yamllint disable-line rule:line-length | |
if: ${{ needs.preconditions.outputs.libs_langchain == 'true' || needs.preconditions.outputs.libs_colbert == 'true' || needs.preconditions.outputs.libs_llamaindex == 'true' }} | |
run: tox -e unit-tests && rm -rf .tox | |
- name: "Unit tests (ragulate)" | |
if: ${{ needs.preconditions.outputs.libs_ragulate == 'true' && matrix.python-version != '3.9' }} | |
run: tox -e unit-tests -c libs/ragulate && rm -rf libs/ragulate/.tox | |
- name: "Unit tests (colbert)" | |
if: ${{ needs.preconditions.outputs.libs_colbert == 'true' }} | |
run: tox -e unit-tests -c libs/colbert && rm -rf libs/colbert/.tox | |
- name: "Unit tests (langchain)" | |
if: ${{ needs.preconditions.outputs.libs_langchain == 'true' }} | |
run: tox -e unit-tests -c libs/langchain && rm -rf libs/langchain/.tox | |
- name: "Unit tests (llamaindex)" | |
if: ${{ needs.preconditions.outputs.libs_llamaindex == 'true' }} | |
run: tox -e unit-tests -c libs/llamaindex && rm -rf libs/llamaindex/.tox | |
- name: "Unit tests (knowledge-store)" | |
if: ${{ needs.preconditions.outputs.libs_knowledge_store == 'true' }} | |
run: tox -e unit-tests -c libs/knowledge-store && rm -rf libs/knowledge-store/.tox | |
- name: "Unit tests (knowledge-graph)" | |
# yamllint disable-line rule:line-length | |
if: ${{ needs.preconditions.outputs.libs_knowledge_graph == 'true' && matrix.python-version != '3.9' && matrix.python-version != '3.10' }} | |
env: | |
OPENAI_API_KEY: "${{ secrets.E2E_TESTS_OPEN_AI_KEY }}" | |
run: tox -e unit-tests -c libs/knowledge-graph && rm -rf libs/knowledge-graph/.tox | |
integration-tests: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
if: ${{ needs.preconditions.outputs.integration_tests == 'true' }} | |
needs: ["preconditions"] | |
timeout-minutes: 30 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: "Setup: Python 3.11" | |
uses: ./.github/actions/setup-python | |
- name: Setup AstraDB | |
uses: nicoloboschi/setup-astradb@v1 | |
id: astra-db | |
with: | |
token: ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }} | |
env: "DEV" | |
region: "us-west-2" | |
cloud: "aws" | |
- name: "Integration tests" | |
env: | |
ASTRA_DB_TOKEN: "${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }}" | |
ASTRA_DB_ID: "${{ steps.astra-db.outputs.id }}" | |
ASTRA_DB_ENV: "DEV" | |
OPENAI_API_KEY: "${{ secrets.E2E_TESTS_OPEN_AI_KEY }}" | |
run: | | |
set -ex | |
run_itests() { | |
local dir=$1 | |
tox -e integration-tests -c $dir | |
rm -rf $dir/.tox | |
} | |
if [[ "true" == "${{ needs.preconditions.outputs.libs_colbert }}" ]]; then | |
run_itests libs/colbert | |
fi | |
if [[ "true" == "${{ needs.preconditions.outputs.libs_knowledge_store }}" ]]; then | |
run_itests libs/knowledge-store | |
fi | |
if [[ "true" == "${{ needs.preconditions.outputs.libs_langchain }}" ]]; then | |
run_itests libs/langchain | |
fi | |
if [[ "true" == "${{ needs.preconditions.outputs.libs_llamaindex }}" ]]; then | |
run_itests libs/llamaindex | |
fi | |
- name: Cleanup AstraDB | |
uses: nicoloboschi/cleanup-astradb@v1 | |
if: ${{ always() && steps.astra-db.outputs.name != '' }} | |
with: | |
token: ${{ secrets.E2E_TESTS_ASTRA_DEV_DB_TOKEN }} | |
name: ${{ steps.astra-db.outputs.name }} | |
env: "DEV" | |
wait: false |