166 lines
No EOL
5 KiB
YAML
166 lines
No EOL
5 KiB
YAML
name: test | environments
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
RUNTIME__LOG_LEVEL: ERROR
|
|
|
|
jobs:
|
|
get_docs_changes:
|
|
name: docs changes
|
|
uses: ./.github/workflows/get_docs_changes.yml
|
|
|
|
run_common:
|
|
name: test
|
|
needs: get_docs_changes
|
|
if: needs.get_docs_changes.outputs.changes_outside_docs == 'true'
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ["ubuntu-latest", "macos-latest"] #, "windows-latest"
|
|
python-version: ["3.11.x"]
|
|
# Test all python versions on ubuntu only
|
|
include:
|
|
- python-version: "3.9.x"
|
|
os: "ubuntu-latest"
|
|
- python-version: "3.10.x"
|
|
os: "ubuntu-latest"
|
|
# - python-version: "3.12.x"
|
|
# os: "ubuntu-latest"
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@master
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install tzdata on windows
|
|
run: |
|
|
cd %USERPROFILE%
|
|
curl https://data.iana.org/time-zones/releases/tzdata2021e.tar.gz --output tzdata.tar.gz
|
|
mkdir tzdata
|
|
tar --extract --file tzdata.tar.gz --directory tzdata
|
|
mkdir %USERPROFILE%\Downloads\tzdata
|
|
copy tzdata %USERPROFILE%\Downloads\tzdata
|
|
curl https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml --output %USERPROFILE%\Downloads\tzdata\windowsZones.xml
|
|
if: runner.os == 'Windows'
|
|
shell: cmd
|
|
|
|
- name: Install Poetry
|
|
# https://github.com/snok/install-poetry#running-on-windows
|
|
uses: snok/install-poetry@v1.3.2
|
|
with:
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
installer-parallel: true
|
|
|
|
- name: Install dependencies
|
|
run: poetry install --no-interaction
|
|
|
|
- name: Create .cognee_system directory and print path
|
|
run: |
|
|
mkdir .cognee_system
|
|
echo $(pwd)/.cognee_system
|
|
|
|
|
|
- name: Run tests
|
|
run: poetry run pytest tests/
|
|
|
|
- name: Run default basic pipeline
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
ENV: 'dev'
|
|
run: poetry run python ./cognee/tests/test_library.py
|
|
|
|
- name: Build with Poetry
|
|
run: poetry build
|
|
|
|
- name: Install Package
|
|
run: |
|
|
cd dist
|
|
pip install *.whl
|
|
|
|
# - run: |
|
|
# poetry run
|
|
# if: runner.os != 'Windows'
|
|
# name: Run common tests with minimum dependencies Linux/MAC
|
|
# env:
|
|
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
# QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
|
|
# QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }}
|
|
|
|
# - run: |
|
|
# poetry run python ./cognee/tests/test_library.py
|
|
# if: runner.os == 'Windows'
|
|
# name: Run common tests with minimum dependencies Windows
|
|
# env:
|
|
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
# QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
|
|
# QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }}
|
|
# shell: cmd
|
|
|
|
# - name: Install dependencies
|
|
# run: poetry install --no-interaction
|
|
|
|
# - name: Build with Poetry
|
|
# run: poetry build
|
|
|
|
# - name: Install Package
|
|
# run: |
|
|
# cd dist
|
|
# pip install *.whl
|
|
|
|
# - name: Download NLTK Punkt Tokenizer Models
|
|
# run: |
|
|
# python -m nltk.downloader punkt
|
|
# - run: |
|
|
# poetry run python ./cognee/tests/test_library.py
|
|
# if: runner.os != 'Windows'
|
|
# name: Run pipeline smoke tests with minimum deps Linux/MAC
|
|
# env:
|
|
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
# QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
|
|
# QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }}
|
|
|
|
# - name: Download NLTK Punkt Tokenizer Models
|
|
# run: |
|
|
# python -m nltk.downloader punkt
|
|
# - run: |
|
|
# poetry run python ./cognee/tests/test_library.py
|
|
# if: runner.os == 'Windows'
|
|
# name: Run smoke tests with minimum deps Windows
|
|
# env:
|
|
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
# QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
|
|
# QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }}
|
|
# shell: cmd
|
|
|
|
|
|
matrix_job_required_check:
|
|
name: common | common tests
|
|
needs: run_common
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
- name: Check matrix job results
|
|
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
|
|
run: |
|
|
echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1 |