Skip to content

add AutoCondition import #24

add AutoCondition import

add AutoCondition import #24

Workflow file for this run

name: tests
on:
push:
branches:
- main
paths:
- "**.py"
- "requirements.txt"
- ".github/workflows/*.yml"
pull_request:
branches:
- main
paths:
- "**.py"
- "requirements.txt"
- ".github/workflows/*.yml"
jobs:
check_code_quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "setup.py"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ruff
python -m pip install .[dev]
- name: Check quality
run: |
make style && make quality
tests:
needs: check_code_quality
env:
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DEFAULT_EMBED_MODEL: text-embedding-ada-002
DEFAULT_CHAT_MODEL: gpt-3.5-turbo
HF_TOKENIZER_PATH: 01-ai/Yi-6B-Chat
DEFAULT_CHUNK_SIZE: 300
DEFAULT_CHUNK_OVERLAP: 100
STORAGE: redis
SEARCH_TARGET: content
REDIS_URI: redis://localhost:6379
ELASTICSEARCH_URI: http://localhost:9200
VECTORSTORE: chroma
CHROMA_PATH: ./chroma
MILVUS_URI: http://localhost:19530
MILVUS_TOKEN: 0
services:
redis:
image: redis
ports:
- 6379:6379
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "setup.py"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
python -m pip install pytest
wget https://github.com/milvus-io/milvus/releases/download/v2.4.4/milvus-standalone-docker-compose.yml -O docker-compose.yml
sudo docker compose up -d
- name: Test with pytest
run: |
make test
- name: Configure Elasticsearch
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 8.14.1
security-enabled: false
- name: Test on es and milvus
env:
STORAGE: es
VECTORSTORE: milvus
run: |
make test