main: Enhance system metrics, hardware specs, and logging dashboard #32
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: Syntax Check | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| paths: | |
| - "**/*.py" | |
| - "**/*.cpp" | |
| - "**/*.c" | |
| - "**/*.h" | |
| - "**/*.hpp" | |
| pull_request: | |
| branches: [ "master" ] | |
| paths: | |
| - "**/*.py" | |
| - "**/*.cpp" | |
| - "**/*.c" | |
| - "**/*.h" | |
| - "**/*.hpp" | |
| jobs: | |
| syntax-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # --- Python Syntax Check --- | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python Linter | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 | |
| - name: Lint Python Files | |
| run: | | |
| # E9, F63, F7, F82 checks syntax errors & undefined variables | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| - name: Check C/C++ Syntax | |
| run: | | |
| echo "Checking C and C++ files for syntax errors..." | |
| errors=0 | |
| # Loop through C files (-I. includes local root directory for header lookups) | |
| while read -r file; do | |
| if [ -z "$file" ]; then continue; fi | |
| echo "Checking $file" | |
| if ! gcc -fsyntax-only -I. "$file"; then | |
| echo "::error file=$file::Syntax error in $file" | |
| errors=$((errors + 1)) | |
| fi | |
| done < <(find . -type f -name "*.c") | |
| # Loop through C++ files | |
| while read -r file; do | |
| if [ -z "$file" ]; then continue; fi | |
| echo "Checking $file" | |
| if ! g++ -fsyntax-only -I. "$file"; then | |
| echo "::error file=$file::Syntax error in $file" | |
| errors=$((errors + 1)) | |
| fi | |
| done < <(find . -type f -name "*.cpp") | |
| if [ $errors -ne 0 ]; then | |
| echo "$errors file(s) failed syntax verification." | |
| exit 1 | |
| fi | |
| echo "All C, C++, and Python files passed syntax checks!" |