Backend optimization #36
Workflow file for this run
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: Unit tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- 'src/backend/**' | |
env: | |
REQUIRED_COVERAGE: 95 | |
jobs: | |
unit-tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install and start Redis server | |
run: | | |
sudo apt update -y | |
sudo apt install redis-server -y | |
sudo systemctl start redis-server | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Python dependencies | |
run: python3 -m pip install -r src/backend/requirements-dev.txt | |
- name: Run unit tests | |
working-directory: src/backend | |
run: coverage run manage.py test | |
- name: Check coverage | |
working-directory: src/backend | |
run: coverage report -m --skip-covered --omit="tests/*,platforms/telegram_app/bot/*,platforms/telegram_app/framework.py,platforms/**/notifications.py" --fail-under=$REQUIRED_COVERAGE |