Merge branch 'feature/issue-332-scoped-coaching-sessions' into dev #518
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: CI/CD Pipeline | |
| on: | |
| # Only trigger on push to dev/master (after PR merge) | |
| push: | |
| branches: | |
| - dev | |
| - master | |
| paths: | |
| - 'coaching/**/*.py' | |
| - 'shared/**/*.py' | |
| - 'pyproject.toml' | |
| - 'pytest.ini' | |
| # Allow manual trigger | |
| workflow_dispatch: {} | |
| jobs: | |
| lint-and-test: | |
| name: Lint, Type Check & Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.14'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-${{ matrix.python-version }}- | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r coaching/requirements.txt | |
| pip install -r coaching/requirements-dev.txt | |
| - name: Run Ruff (Linting) | |
| run: | | |
| python -m ruff check coaching/ shared/ --output-format=github | |
| continue-on-error: false | |
| - name: Run Ruff (Format Check) | |
| run: | | |
| python -m ruff format --check coaching/ shared/ | |
| continue-on-error: false | |
| - name: Run MyPy (Type Checking) | |
| run: | | |
| python -m mypy coaching/src shared/ --explicit-package-bases | |
| continue-on-error: true # Don't fail build on type warnings for now | |
| - name: Run Pytest (Unit Tests) | |
| run: | | |
| python -m pytest coaching/tests/unit -v --tb=short --cov=coaching/src --cov=shared --cov-report=term-missing \ | |
| --ignore=coaching/tests/unit/workflows/test_refactored_workflows.py \ | |
| --ignore=coaching/tests/unit/test_insights_service.py \ | |
| --ignore=coaching/tests/unit/test_onboarding_service.py \ | |
| --ignore=coaching/tests/test_llm_service_refactoring.py \ | |
| --ignore=coaching/tests/test_langgraph_workflows.py \ | |
| --ignore=coaching/tests/test_business_data_api.py \ | |
| --ignore=coaching/tests/unit/test_models.py \ | |
| --ignore=coaching/tests/unit/test_response_models.py \ | |
| --ignore=coaching/tests/unit/api/test_admin_topics.py \ | |
| --ignore=coaching/tests/unit/api/test_conversations_api.py \ | |
| --ignore=coaching/tests/unit/api/test_topics_api.py \ | |
| --ignore=coaching/tests/unit/domain/entities/test_conversation.py \ | |
| --ignore=coaching/tests/unit/domain/entities/test_prompt_template.py \ | |
| --ignore=coaching/tests/unit/domain/events/test_analysis_events.py \ | |
| --ignore=coaching/tests/unit/domain/events/test_conversation_events.py \ | |
| --ignore=coaching/tests/unit/domain/exceptions/test_conversation_exceptions.py \ | |
| --ignore=coaching/tests/unit/domain/services/test_alignment_calculator.py \ | |
| --ignore=coaching/tests/unit/domain/services/test_completion_validator.py \ | |
| --ignore=coaching/tests/unit/domain/services/test_phase_transition_service.py \ | |
| --ignore=coaching/tests/unit/domain/value_objects/test_conversation_context.py | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.python-version == '3.14' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: false | |
| security-scan: | |
| name: Security Scan | |
| 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.14' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r coaching/requirements.txt | |
| - name: Run Bandit (Security) | |
| run: | | |
| pip install bandit[toml] | |
| bandit -r coaching/src shared/ -ll | |
| continue-on-error: true | |
| - name: Check for known vulnerabilities | |
| run: | | |
| pip install safety | |
| safety check --json | |
| continue-on-error: true | |