refactor(tickets): migrate platform ticket list to shared components (#152) #350
Workflow file for this run
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
| # =============================================================================== | |
| # PORTAL SERVICE CI/CD - API-ONLY, NO DATABASE ACCESS | |
| # =============================================================================== | |
| # Tests and type checking for the portal service. | |
| # Linting is consolidated in integration.yml (make lint). | |
| name: Portal Service CI/CD | |
| on: | |
| push: | |
| branches: [master, staging] | |
| paths: | |
| - 'services/portal/**' | |
| - 'shared/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '.github/workflows/portal.yml' | |
| pull_request: | |
| branches: [master] | |
| paths: | |
| - 'services/portal/**' | |
| - 'shared/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '.github/workflows/portal.yml' | |
| workflow_dispatch: | |
| env: | |
| DJANGO_SETTINGS_MODULE: config.settings.dev | |
| DJANGO_SECRET_KEY: test-secret-key-for-ci | |
| PLATFORM_API_URL: http://mock-platform:8000 | |
| PLATFORM_API_KEY: test-api-key | |
| UV_PROJECT_ENVIRONMENT: ${{ github.workspace }}/.venv-linux | |
| jobs: | |
| portal-test: | |
| runs-on: ubuntu-latest | |
| # NO DATABASE SERVICES - Portal should not access DB! | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv and sync dependencies | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python and install dependencies | |
| run: | | |
| uv python install | |
| uv sync --group portal --group dev | |
| - name: Validate portal has no external database dependencies | |
| run: | | |
| cd services/portal | |
| if grep -iP "psycopg|mysql-connector|mysqlclient|cx.oracle" pyproject.toml 2>/dev/null; then | |
| echo "SECURITY FAILURE: Portal has external database drivers in pyproject.toml!" | |
| exit 1 | |
| fi | |
| if grep -r "psycopg\|mysql\|oracle" config/settings* 2>/dev/null; then | |
| echo "SECURITY FAILURE: Portal has external database configuration!" | |
| exit 1 | |
| fi | |
| echo "Portal settings use only SQLite (Django internals only)" | |
| - name: Run portal unit tests with coverage | |
| run: | | |
| cd services/portal | |
| PYTHONPATH=$(pwd) ${{ env.UV_PROJECT_ENVIRONMENT }}/bin/pytest tests/ -v --tb=short --maxfail=10 --cov=apps --cov-report=xml:coverage-portal.xml --cov-report=term-missing | |
| - name: Portal type checking (make check-types-portal) | |
| run: make check-types-portal | |
| - name: Upload portal artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: portal-reports | |
| path: | | |
| services/portal/htmlcov/ | |
| services/portal/coverage-portal.xml | |
| if-no-files-found: warn |