Merge branch 'generic-naming' into main #62
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # Cancel in-flight runs of the same branch on a new push. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint & static checks | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install lint tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff bandit mypy | |
| # Excluded files mirror the manual lint pass in HISTORY.md / PLAN.md | |
| # (large legacy modules that we deliberately don't gate on). | |
| - name: Ruff (medium+ severity rule set) | |
| run: | | |
| ruff check \ | |
| --select=F821,S105,S324,B904,B008,E711,E712,E722,RUF012,S607,S101 \ | |
| --exclude='translator*.py,gladia*.py,fn2md.py,exchange_cli.py,format_transplant.py,tr_gemma.py,yt_tk*.py,jobs/,tests/' \ | |
| . | |
| - name: Bandit (medium+ severity) | |
| run: | | |
| bandit -r . \ | |
| -x './translator.py,./translator-app.py,./gladia.py,./gladia_handler.py,./fn2md.py,./exchange_cli.py,./format_transplant.py,./tr_gemma.py,./yt_tk.py,./yt_tk_vps.py,./jobs,./tests,./.mypy_cache,./.ruff_cache,./.pytest_cache,./build,./generated_images,./static,./storage,./__pycache__' \ | |
| -ll | |
| - name: Mypy (touched files only — full-repo mypy is too noisy yet) | |
| run: | | |
| mypy \ | |
| --ignore-missing-imports \ | |
| --no-error-summary \ | |
| --follow-imports=silent \ | |
| crispasr_tool.py \ | |
| transcription_utils.py \ | |
| provider_utils.py \ | |
| config.py \ | |
| dictation_manager.py | |
| smoke-import: | |
| name: Smoke import (catches F821 etc.) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install runtime deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install only the deps we need to import the entrypoint modules. | |
| # The full requirements.txt has heavy ML libs we don't need to | |
| # smoke-test the import graph. | |
| pip install -r requirements.txt || pip install \ | |
| gradio openai requests sqlalchemy cryptography \ | |
| python-dotenv pydub python-docx defusedxml httpx websockets \ | |
| bcrypt beautifulsoup4 | |
| - name: Import core modules | |
| env: | |
| MASTER_ENCRYPTION_KEY: "ci-placeholder-not-secret-32-bytes-long-padding-zzzz" | |
| run: | | |
| python -c " | |
| import config | |
| import provider_utils | |
| import crispasr_tool | |
| import transcription_utils | |
| import dictation_manager | |
| import storage_utils | |
| print('core imports OK') | |
| " | |
| pytest: | |
| name: Unit + integration tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install runtime + test deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt || pip install \ | |
| gradio openai requests sqlalchemy cryptography \ | |
| python-dotenv pydub python-docx defusedxml httpx websockets numpy \ | |
| bcrypt beautifulsoup4 yt-dlp | |
| pip install pytest pytest-asyncio responses | |
| - name: Run pytest | |
| env: | |
| MASTER_ENCRYPTION_KEY: "ci-placeholder-not-secret-32-bytes-long-padding-zzzz" | |
| EXCHANGE_SERVER: "test.server.com" | |
| EXCHANGE_USER: "testuser" | |
| EXCHANGE_PASSWORD: "testpass" | |
| EXCHANGE_EMAIL: "test@example.com" | |
| run: | | |
| pytest tests/ -v --tb=short \ | |
| -m "not live" \ | |
| --ignore=tests/test_exchange.py \ | |
| --ignore=tests/test_exchange_calendar.py \ | |
| --ignore=tests/test_exchange_contacts.py \ | |
| --ignore=tests/test_integration.py | |
| # Exchange tests use exchangelib which needs a working server; skip on CI. | |
| # Run them locally with `pytest tests/test_exchange*.py` for now. |