Skip to content

docs: improve README and add MIT license #4

docs: improve README and add MIT license

docs: improve README and add MIT license #4

Workflow file for this run

name: Python Tests
on:
push:
branches: [main, develop]
paths:
- "backend/**"
- ".github/workflows/python-tests.yml"
pull_request:
branches: [main]
paths:
- "backend/**"
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bi_platform
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
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
pip install pytest pytest-cov
- name: Initialize database tables
working-directory: ./backend
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/bi_platform
REDIS_HOST: localhost
REDIS_PORT: 6379
run: |
python -c "
from app import models

Check failure on line 67 in .github/workflows/python-tests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/python-tests.yml

Invalid workflow file

You have an error in your yaml syntax on line 67
from app.database import init_db
init_db()
print('Database tables created successfully')
"
- name: Run tests
working-directory: ./backend
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/bi_platform
REDIS_HOST: localhost
REDIS_PORT: 6379
run: |
pytest tests/ -v --cov=app --cov-report=xml --cov-report=term
- name: Upload coverage
if: always()
uses: codecov/codecov-action@v3
with:
file: ./backend/coverage.xml
fail_ci_if_error: false