Skip to content

fix(ci): Resolve Windows CI workflow failures #3

fix(ci): Resolve Windows CI workflow failures

fix(ci): Resolve Windows CI workflow failures #3

Workflow file for this run

name: Code Quality
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
syntax-check:
runs-on: windows-latest
name: Python Syntax Check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PySide6
- name: Check Python syntax
run: |
echo "Checking Python syntax..."
python -m py_compile main.py
python -c "import os, py_compile; [py_compile.compile(os.path.join(dp, f), doraise=True) for dp, dn, files in os.walk('core') if f.endswith('.py')]"
python -c "import os, py_compile; [py_compile.compile(os.path.join(dp, f), doraise=True) for dp, dn, files in os.walk('core/ui') if f.endswith('.py')]"
echo "All files compile successfully"
lint-check:
runs-on: windows-latest
name: Code Linting
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install linters
run: |
python -m pip install --upgrade pip
pip install pyflakes
- name: Run pyflakes
shell: pwsh
run: |
echo "Running pyflakes..."
pyflakes main.py
pyflakes core/overlay.py
pyflakes core/input_mon.py
pyflakes core/settings_manager.py
pyflakes core/configuration.py
pyflakes core/gui.py
pyflakes core/logging_config.py
pyflakes core/ui/components.py
echo "No linting errors found"
import-check:
runs-on: windows-latest
name: Import Validation
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PySide6
- name: Test imports
shell: pwsh
run: |
echo "Testing module imports..."
python -c "import main; print('main.py imports successfully')"
python -c "import core.overlay; print('core.overlay imports successfully')"
python -c "import core.input_mon; print('core.input_mon imports successfully')"
python -c "import core.settings_manager; print('core.settings_manager imports successfully')"
python -c "import core.configuration; print('core.configuration imports successfully')"
python -c "import core.gui; print('core.gui imports successfully')"
python -c "import core.ui.components; print('core.ui.components imports successfully')"
python -c "import core.logging_config; print('core.logging_config imports successfully')"
type-check:
runs-on: windows-latest
name: Type Validation
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check type hints
shell: pwsh
run: |
echo "Checking for type annotation issues..."
python -c "import ast, sys; files_to_check = ['main.py', 'core/overlay.py', 'core/input_mon.py', 'core/settings_manager.py', 'core/configuration.py', 'core/gui.py', 'core/ui/components.py']; all_ok = True; exec(open('type_check.py', 'w').write('import ast, sys\n\ndef check_file(filepath):\n with open(filepath, 'r', encoding='utf-8') as f:\n try:\n tree = ast.parse(f, filepath)\n except SyntaxError as e:\n print(f\"ERROR {filepath}: {e}\")\n return False\n return True\n\nfiles_to_check = \"' + \"', '\".join(files_to_check) + '\")\n\nall_ok = True\nfor filepath in files_to_check:\n if check_file(filepath):\n print(f\"OK {filepath} type hints valid\")\n else:\n all_ok = False\n\nif not all_ok:\n sys.exit(1)\n')); exec(open('type_check.py').read()); python type_check.py"
config-validation:
runs-on: windows-latest
name: Configuration Validation
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PySide6
- name: Validate config schema
shell: pwsh
run: |
echo "Testing configuration validation..."
python -c "from core.settings_manager import SettingsManager; from core.configuration import AppConfig; config = AppConfig(); print('Default configuration created successfully'); settings = SettingsManager(); print('Schema validation passed')"
summary:
runs-on: windows-latest
name: Quality Summary
needs: [syntax-check, lint-check, import-check, type-check, config-validation]
steps:
- name: All checks passed
run: |
echo "## Quality Summary"
echo ""
echo "| Check | Status |"
echo "|-------|--------|"
echo "| Python Syntax | Passed |"
echo "| Linting | Passed |"
echo "| Imports | Passed |"
echo "| Type Hints | Passed |"
echo "| Config Validation | Passed |"
echo ""
echo "All quality checks passed successfully!"