Bugfix #42
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
# Workflow to test the FastAPI routes | |
name: CI - Backend | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
workflow_dispatch: | |
jobs: | |
installation: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
cd backend | |
pip install -qr requirements.txt | |
test_topics: # test the topics/ route | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
cd backend | |
pip install -qr requirements.txt | |
pip install -qr requirements-test.txt | |
- name: Start FastAPI server | |
run: | | |
cd backend | |
nohup uvicorn main:app & | |
sleep 5 | |
- name: Run tests | |
run: | | |
cd backend | |
pytest tests/topics/*.py |