Improve CI, reindexing, qdrant, and deletion #1187
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: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "0.5.27" | |
| - name: Set up Python | |
| run: uv python install 3.11 | |
| - name: Cache uv dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/uv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - 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- | |
| # requirements.txt is the dependency source of truth (test deps included); | |
| # there is no pyproject/uv.lock in this repo — `uv sync --locked` can never | |
| # succeed here and left CI red on every run. | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| uv 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 | |
| - name: Pre-download embedding model | |
| run: | | |
| uv 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: uv run python -m 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 |