Skip to content

fix(vol): formattig issues #166

fix(vol): formattig issues

fix(vol): formattig issues #166

Workflow file for this run

name: Backend CI
on:
push:
branches: [ main, develop ]
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'
pull_request:
branches: [ main, develop ]
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
working-directory: ./backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run linting with flake8
working-directory: ./backend
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run linting with black
working-directory: ./backend
run: |
black --check .
- name: Run migrations
working-directory: ./backend
env:
DEBUG: 'True'
CORS_ALLOWED_ORIGIN: 'http://localhost:5173'
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
python manage.py migrate
- name: Run tests with pytest
working-directory: ./backend
env:
DEBUG: 'True'
CORS_ALLOWED_ORIGIN: 'http://localhost:5173'
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
pytest --cov=. --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./backend/coverage.xml
flags: backend
fail_ci_if_error: false