Skip to content

Commit

Permalink
Add rag test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed Apr 4, 2024
1 parent 28ef13a commit 2db8123
Showing 1 changed file with 60 additions and 13 deletions.
73 changes: 60 additions & 13 deletions .github/workflows/rag.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,71 @@
name: Build/Test RAG Engine
name: Build and test

on:
push:
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"
pull_request:
paths:
- "nesis/rag/core/**"
- "nesis/rag/tests/**"
- "nesis/rag/core/requirements*"
# paths:
# - "nesis/rag/core/**"
# - "nesis/rag/tests/**"
# - "nesis/rag/core/requirements*"
# pull_request:
# paths:
# - "nesis/rag/core/**"
# - "nesis/rag/tests/**"
# - "nesis/rag/core/requirements*"

jobs:
check-code-quality:

format:
runs-on: ubuntu-latest
name: Check API code format
steps:
- name: Check out source
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
test:
runs-on: ubuntu-latest
name: Check code Quality
name: Test API
services:
postgres:
image: ametnes/postgresql:16-debian-12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: nesis
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd "pg_isready -h localhost -U $$POSTGRES_USER"
--health-interval 10s
--health-timeout 5s
--health-retries 10
memcached:
image: bitnami/memcached:1.6.19
ports:
- 11211:11211
steps:
- name: Check out source
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r nesis/rag/requirements.txt -r nesis/rag/requirements-test.txt -r nesis/rag/requirements-huggingface.txt
- name: Run unit tests
env:
NESIS_API_DATABASE_URL: "postgresql://postgres:password@localhost:5432/nesis"
NESIS_ADMIN_EMAIL: "[email protected]"
NESIS_ADMIN_PASSWORD: "password"
NESIS_MEMCACHE_HOSTS: localhost:11211
run: |
pytest nesis/rag/tests/

0 comments on commit 2db8123

Please sign in to comment.