tiny fix #37
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: 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-4o-mini | |
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 | |
GRAPH_STORAGE: neo4j | |
NEO4J_URI: bolt://localhost:7687 | |
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 | |
docker run -it --rm \ | |
--publish=7474:7474 --publish=7687:7687 \ | |
--env NEO4J_AUTH=none \ | |
--env NEO4J_PLUGINS='["apoc","graph-data-science"]' \ | |
--env NEO4J_dbms_security_procedures_unrestricted=gds.*,apoc.*\ | |
--env NEO4J_dbms_security_procedures_allowlist=gds.*,apoc.*\ | |
--volume=plugins:/plugins\ | |
--volume=data:/data\ | |
neo4j:5.11.0 | |
- 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 |