Update tests workflow. #5
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: LegaBot Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'database/**' | |
- 'router/**' | |
- 'llm/**' | |
- 'app.py' | |
- 'requirements.txt' | |
- '.github/workflows/**' | |
jobs: | |
test_database: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.paths == 'database/**' }} | |
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 Database Tests | |
run: python -m unittest tests/test_database.py | |
test_router: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.paths == 'router/**' }} | |
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 Router Tests | |
run: python -m unittest tests/test_router.py | |
test_llm: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.paths == 'llm/**' }} | |
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 LLM Tests | |
run: python -m unittest tests/test_llm.py | |
test_all: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.pull_request.paths == '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 |