-
Notifications
You must be signed in to change notification settings - Fork 1
160 lines (133 loc) · 5.57 KB
/
Copy pathci.yml
File metadata and controls
160 lines (133 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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!"