fix typos #1934
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.10' # Use a stable Python version | |
- name: Install Poetry and dependencies | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
cd py && poetry install -E core -E ingestion-bundle | |
- name: Remove pre-installed PostgreSQL | |
run: | | |
sudo apt-get purge -y 'postgresql-*' | |
sudo rm -rf /var/lib/postgresql | |
sudo rm -rf /var/log/postgresql | |
sudo rm -rf /etc/postgresql | |
- name: Add PostgreSQL Apt Repository | |
run: | | |
# Add the PostgreSQL Apt repository | |
echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list | |
# Download and add the repository GPG key | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg | |
- name: Install PostgreSQL 15 and pgvector | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y postgresql-15 postgresql-client-15 postgresql-15-pgvector | |
- name: Start PostgreSQL 15 service | |
run: | | |
sudo systemctl enable postgresql@15-main | |
sudo systemctl start postgresql@15-main | |
- name: Configure PostgreSQL | |
run: | | |
# Change to a directory accessible by the postgres user to avoid permission warnings | |
cd / | |
sudo -u postgres /usr/lib/postgresql/15/bin/psql -c "ALTER USER postgres PASSWORD 'postgres';" | |
sudo -u postgres /usr/lib/postgresql/15/bin/psql -c "CREATE EXTENSION vector;" | |
- name: Start R2R server | |
working-directory: ./py | |
run: | | |
poetry run r2r serve & | |
echo "Waiting for services to start..." | |
sleep 30 | |
- name: Run CLI Ingestion | |
working-directory: ./py | |
run: | | |
poetry run python tests/integration/harness_cli.py test_ingest_sample_file_cli | |
poetry run python tests/integration/harness_cli.py test_document_overview_sample_file_cli | |
poetry run python tests/integration/harness_cli.py test_document_chunks_sample_file_cli | |
poetry run python tests/integration/harness_cli.py test_delete_and_reingest_sample_file_cli | |
- name: Run CLI Retrieval | |
working-directory: ./py | |
run: | | |
poetry run python tests/integration/harness_cli.py test_vector_search_sample_file_filter_cli | |
poetry run python tests/integration/harness_cli.py test_rag_response_sample_file_cli | |
poetry run python tests/integration/harness_cli.py test_rag_response_stream_sample_file_cli | |
- name: Run SDK Ingestion | |
working-directory: ./py | |
run: | | |
poetry run python tests/integration/harness_sdk.py test_ingest_sample_file_sdk | |
poetry run python tests/integration/harness_sdk.py test_reingest_sample_file_sdk | |
poetry run python tests/integration/harness_sdk.py test_document_overview_sample_file_sdk | |
poetry run python tests/integration/harness_sdk.py test_document_chunks_sample_file_sdk | |
poetry run python tests/integration/harness_sdk.py test_delete_and_reingest_sample_file_sdk | |
poetry run python tests/integration/harness_sdk.py test_ingest_sample_file_with_config_sdk | |
- name: Run SDK Retrieval | |
working-directory: ./py | |
run: | | |
poetry run python tests/integration/harness_sdk.py test_vector_search_sample_file_filter_sdk | |
poetry run python tests/integration/harness_sdk.py test_hybrid_search_sample_file_filter_sdk | |
poetry run python tests/integration/harness_sdk.py test_rag_response_sample_file_sdk | |
- name: Run SDK Auth | |
working-directory: ./py | |
run: | | |
poetry run python tests/integration/harness_sdk.py test_user_registration_and_login | |
poetry run python tests/integration/harness_sdk.py test_duplicate_user_registration | |
poetry run python tests/integration/harness_sdk.py test_token_refresh | |
poetry run python tests/integration/harness_sdk.py test_user_document_management | |
poetry run python tests/integration/harness_sdk.py test_user_search_and_rag | |
poetry run python tests/integration/harness_sdk.py test_user_password_management | |
poetry run python tests/integration/harness_sdk.py test_user_profile_management | |
poetry run python tests/integration/harness_sdk.py test_user_overview | |
poetry run python tests/integration/harness_sdk.py test_user_logout | |
- name: Run Collections | |
working-directory: ./py | |
run: | | |
poetry run python tests/integration/harness_sdk.py test_user_creates_collection | |
poetry run python tests/integration/harness_sdk.py test_user_updates_collection | |
poetry run python tests/integration/harness_sdk.py test_user_lists_collections | |
poetry run python tests/integration/harness_sdk.py test_user_collection_document_management | |
poetry run python tests/integration/harness_sdk.py test_user_removes_document_from_collection | |
poetry run python tests/integration/harness_sdk.py test_user_lists_documents_in_collection | |
poetry run python tests/integration/harness_sdk.py test_pagination_and_filtering | |
poetry run python tests/integration/harness_sdk.py test_advanced_collection_management | |
poetry run python tests/integration/harness_sdk.py test_user_gets_collection_details | |
poetry run python tests/integration/harness_sdk.py test_user_adds_user_to_collection | |
poetry run python tests/integration/harness_sdk.py test_user_removes_user_from_collection | |
poetry run python tests/integration/harness_sdk.py test_user_lists_users_in_collection | |
poetry run python tests/integration/harness_sdk.py test_user_gets_collections_for_user | |
poetry run python tests/integration/harness_sdk.py test_user_gets_collections_for_document | |
poetry run python tests/integration/harness_sdk.py test_user_permissions | |
- name: Stop R2R server | |
if: always() | |
run: ps aux | grep "r2r serve" | awk '{print $2}' | xargs kill || true | |
- name: Uninstall PostgreSQL after tests (Optional) | |
if: always() | |
run: | | |
sudo apt-get purge -y 'postgresql-*' | |
sudo rm -rf /var/lib/postgresql | |
sudo rm -rf /var/log/postgresql | |
sudo rm -rf /etc/postgresql |