add pgvector #1826
Workflow file for this run
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: R2R CLI Integration and Regression Test | |
on: | |
push: | |
branches: | |
- '**' # Trigger on all branches | |
workflow_dispatch: # Allow manual trigger | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
actions: write | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
TELEMETRY_ENABLED: false | |
POSTGRES_HOST: localhost | |
POSTGRES_DBNAME: postgres | |
POSTGRES_PORT: 5432 | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
R2R_PROJECT_NAME: r2r_default | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install Poetry and dependencies | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
cd py && poetry install -E core -E ingestion-bundle | |
- name: Install and configure PostgreSQL | |
run: | | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install -y postgresql | |
sudo systemctl start postgresql.service | |
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" | |
- name: Install pgvector | |
run: | | |
sudo apt-get install -y build-essential postgresql-server-dev-all | |
git clone https://github.com/pgvector/pgvector.git | |
cd pgvector | |
make | |
sudo make install | |
cd .. | |
sudo -u postgres psql -c "CREATE EXTENSION vector;" | |
- name: Start PostgreSQL | |
run: sudo systemctl start postgresql.service | |
- name: Start R2R server | |
working-directory: ./py | |
run: | | |
poetry run r2r serve & | |
echo "Waiting for services to start..." | |
sleep 30 | |
- name: Run integration tests - Ingestion | |
working-directory: ./py | |
run: | | |
python tests/integration/runner.py test_ingest_sample_files_cli | |
python tests/integration/runner.py test_document_ingestion_cli | |
- name: Stop R2R server | |
if: always() | |
run: pkill -f "r2r serve" |