docs: improve README and add MIT license #4
This file contains hidden or 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: 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 | ||
| 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 | ||