Merge pull request #196 from Context-Engine-AI/chunk #1032
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: [ test ] | |
| pull_request: | |
| branches: [ test ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| qdrant: | |
| image: qdrant/qdrant:latest | |
| ports: | |
| - 6333:6333 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Cache embedding models | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/huggingface | |
| key: ${{ runner.os }}-embeddings-bge-base-en-v1.5 | |
| restore-keys: | | |
| ${{ runner.os }}-embeddings- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Wait for Qdrant to be ready | |
| run: | | |
| timeout 60 bash -c 'until curl -fsS http://localhost:6333/readyz; do sleep 2; done' | |
| - name: Set environment variables | |
| run: | | |
| echo "QDRANT_URL=http://localhost:6333" >> $GITHUB_ENV | |
| echo "PYTHONPATH=${{ github.workspace }}/scripts:$PYTHONPATH" >> $GITHUB_ENV | |
| echo "CI=true" >> $GITHUB_ENV | |
| echo "USE_TREE_SITTER=1" >> $GITHUB_ENV | |
| # Note: COLLECTION_NAME is intentionally NOT set globally. | |
| # Integration tests set their own unique collection names. | |
| # Unit tests mock Qdrant and don't need a real collection. | |
| - name: Pre-download embedding model | |
| run: | | |
| python -c "from fastembed import TextEmbedding; m = TextEmbedding(model_name='BAAI/bge-base-en-v1.5'); list(m.embed(['test']))" | |
| - name: Run tests | |
| run: pytest -q --junitxml=test-results.xml | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: test-results.xml | |
| retention-days: 7 | |
| - name: Test Summary | |
| uses: test-summary/action@v2 | |
| if: always() | |
| with: | |
| paths: test-results.xml |