Skip to content
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

Update tests workflow, separate reqirements installation, add secrets. #32

Merged
merged 1 commit into from
May 5, 2024
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
30 changes: 22 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
changed_files:
test_router:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test Router
steps:
Expand All @@ -19,28 +19,42 @@ jobs:
with:
files: router/**
# files_ignore: docs/static.js

- name: Install Dependencies
if: steps.changed-files-router.outputs.any_changed == 'true'
run: pip install -r requirements.txt

- name: Run step if any file(s) in the router folder change
if: steps.changed-files-router.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files-router.outputs.all_changed_files }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pip install -r requirements.txt
python -m unittest tests/test_router.py

LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }}
LANGFUSE_HOST: ${{ secrets.LANGFUSE_HOST }}
run: python -m unittest tests/test_router.py

test_database:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: Test Database
steps:
- uses: actions/checkout@v4
# Test Database
- name: Get changed files in the database folder
id: changed-files-database
uses: tj-actions/changed-files@v44
with:
files: database/**

- name: Install Dependencies
if: steps.changed-files-database.outputs.any_changed == 'true'
run: pip install -r requirements.txt

- name: Run step if any file(s) in the database folder change
if: steps.changed-files-database.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files-database.outputs.all_changed_files }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pip install -r requirements.txt
python -m unittest tests/test_database.py
QDRANT_CLUSTER_URL: ${{ secrets.QDRANT_CLUSTER_URL }}
QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
run: python -m unittest tests/test_database.py