Add Voice-Controlled Task Management System for Jarvis #18
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
| # Dedicated workflow for Python file testing | |
| # This workflow runs comprehensive tests specifically for Python files | |
| # Separated from main CI to avoid slowing down other checks | |
| name: Python Tests | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] | |
| paths: | |
| - '**.py' | |
| - 'requirements.txt' | |
| - 'tests/**' | |
| - '.github/workflows/python-tests.yml' | |
| pull_request: | |
| branches: [ "main", "develop" ] | |
| paths: | |
| - '**.py' | |
| - 'requirements.txt' | |
| - 'tests/**' | |
| - '.github/workflows/python-tests.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| python-tests: | |
| name: Python Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10", "3.11"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| 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 flake8 pytest pytest-cov black isort mypy | |
| # Install project dependencies if requirements.txt exists | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| - name: Code formatting check with Black | |
| run: | | |
| black --check --diff . | |
| - name: Import sorting check with isort | |
| run: | | |
| isort --check-only --diff . | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=venv,env,.venv,.env,__pycache__ | |
| # exit-zero treats all errors as warnings | |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=venv,env,.venv,.env,__pycache__ | |
| - name: Type checking with mypy | |
| run: | | |
| mypy . --ignore-missing-imports --exclude='venv|env|\.venv|\.env' || true | |
| - name: Run tests with pytest | |
| run: | | |
| pytest tests/ -v --cov=. --cov-report=xml --cov-report=term-missing | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.10' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| security-check: | |
| name: Security Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Install security tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install bandit safety | |
| - name: Run bandit security check | |
| run: | | |
| bandit -r . -f json -o bandit-report.json || true | |
| bandit -r . --exclude ./venv,./env,./.venv,./.env | |
| - name: Check for known security vulnerabilities | |
| run: | | |
| safety check || true |