Skip to content

Update test paths and dirs. #3

Update test paths and dirs.

Update test paths and dirs. #3

Workflow file for this run

name: LegaBot Tests
on:
pull_request:
branches:
- main
paths:
- 'database/**'
- 'router/**'
- 'llm/**'
- 'app.py'
- 'requirements.txt'
- '.github/workflows/**'
jobs:
test-specific:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- folder: 'database/**'
test_path: 'tests/test_database.py'
- folder: 'router/**'
test_path: 'tests/test_router.py'
- folder: 'llm/**'
test_path: 'tests/test_llm.py'
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Run Test
run: python -m unittest ${{ matrix.test_path }}
if: contains(github.event.pull_request.changed_files, matrix.folder)
test-all:
runs-on: ubuntu-latest
needs: test-specific
if: contains(github.event.pull_request.changed_files, 'app.py')
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Run All Tests
run: python -m unittest discover -s tests