Skip to content

Server factor #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .github/workflows/extension_ci.yml
Original file line number Diff line number Diff line change
@@ -45,56 +45,6 @@ jobs:
- name: Clippy
run: cargo clippy

test-core:
runs-on: ubuntu-24.04
services:
postgres:
image: pgvector/pgvector:0.8.0-pg17
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
vector-serve:
image: ghcr.io/chuckhend/vector-serve:latest
ports:
- 3000:3000
steps:
- uses: actions/checkout@v4
- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "extension-test"
workspaces: |
vectorize
# Additional directories to cache
cache-directories: |
/home/runner/.pgrx
- name: Install sys dependencies
run: |
sudo apt-get update && sudo apt-get install -y postgresql postgresql-contrib libopenblas-dev libreadline-dev
- name: Test Core
run: |
cd ../server && cargo test

- name: Test Core - Integration
# skip when on external forks
if: github.repository_owner == 'ChuckHend'
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CO_API_KEY: ${{ secrets.CO_API_KEY }}
PORTKEY_API_KEY: ${{ secrets.PORTKEY_API_KEY }}
PORTKEY_VIRTUAL_KEY_OPENAI: ${{ secrets.PORTKEY_VIRTUAL_KEY_OPENAI }}
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
run: |
cd ../server && cargo test -- --ignored

test:
name: Run tests
runs-on: ubuntu-latest
61 changes: 61 additions & 0 deletions .github/workflows/server_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Vectorize Server CI

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust minimal nightly with clippy and rustfmt
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Cargo format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy

test-server:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install sys dependencies
run: |
sudo apt-get update && sudo apt-get install -y postgresql postgresql-contrib libopenblas-dev libreadline-dev
- name: start containers
env:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
run: |
docker compose -f docker-compose.server.yml up postgres -d;
sleep 5;
docker compose -f docker-compose.server.yml up vector-serve server --build -d;
- name: Test Core
run: |
cargo test
- name: Test Core - Integration
# skip when on external forks
if: github.repository_owner == 'ChuckHend'
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CO_API_KEY: ${{ secrets.CO_API_KEY }}
PORTKEY_API_KEY: ${{ secrets.PORTKEY_API_KEY }}
PORTKEY_VIRTUAL_KEY_OPENAI: ${{ secrets.PORTKEY_VIRTUAL_KEY_OPENAI }}
VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
DATABASE_URL: postgresql://postgres:postgres@0.0.0.0:5432/postgres
run: |
cargo test -- --ignored
- name: debugging info
if: failure()
run: |
docker compose logs
docker ps
Loading