cognee/.github/workflows/python_version_tests.yml
Vasilije c3d33e728e
feat: New tests (#678)
<!-- .github/pull_request_template.md -->

## Description
<!-- Provide a clear description of the changes in this PR -->

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin

---------

Co-authored-by: Daniel Molnar <soobrosa@gmail.com>
Co-authored-by: Igor Ilic <30923996+dexters1@users.noreply.github.com>
Co-authored-by: Igor Ilic <igorilic03@gmail.com>
2025-04-10 10:52:48 +02:00

85 lines
2.4 KiB
YAML

name: Reusable Python Version Tests
on:
workflow_call:
inputs:
python-versions:
required: false
type: string
default: '["3.10.x", "3.11.x", "3.12.x"]'
secrets:
OPENAI_API_KEY:
required: true
GRAPHISTRY_USERNAME:
required: true
GRAPHISTRY_PASSWORD:
required: true
LLM_MODEL:
required: false
LLM_ENDPOINT:
required: false
LLM_API_VERSION:
required: false
EMBEDDING_MODEL:
required: false
EMBEDDING_ENDPOINT:
required: false
EMBEDDING_API_KEY:
required: false
EMBEDDING_API_VERSION:
required: false
env:
RUNTIME__LOG_LEVEL: ERROR
ENV: 'dev'
jobs:
run-python-version-tests:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ${{ fromJSON(inputs.python-versions) }}
os: [ubuntu-22.04, macos-13, macos-15, windows-latest]
fail-fast: false
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cognee Setup
uses: ./.github/actions/cognee_setup
with:
python-version: ${{ inputs.python-version }}
- name: Run unit tests
run: poetry run pytest cognee/tests/unit/
- name: Run integration tests
if: ${{ !contains(matrix.os, 'windows') }}
run: poetry run pytest cognee/tests/integration/
- name: Run default basic pipeline
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
GRAPHISTRY_USERNAME: ${{ secrets.GRAPHISTRY_USERNAME }}
GRAPHISTRY_PASSWORD: ${{ secrets.GRAPHISTRY_PASSWORD }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }}
LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }}
EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }}
EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }}
EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }}
EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }}
run: poetry run python ./cognee/tests/test_library.py
- name: Build with Poetry
run: poetry build
- name: Install Package
if: ${{ !contains(matrix.os, 'windows') }}
run: |
cd dist
pip install *.whl