Files
patreon-downloader/.gitea/workflows/python-syntax.yml

56 lines
1.4 KiB
YAML

name: Code Check - Quality and Syntax
on:
push:
branches: ["**"]
paths:
- '**/*.py'
pull_request:
branches: ["**"]
paths:
- '**/*.py'
jobs:
syntax-lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install flake8
- name: Run Python syntax check
run: |
set -e
files=$(git ls-files '*.py')
if [ -z "$files" ]; then echo "No Python files to check"; exit 0; fi
python -m py_compile $files
- name: Run flake8 lint
run: |
files=$(git ls-files '*.py')
if [ -z "$files" ]; then echo "No Python files to lint"; exit 0; fi
flake8 $files
- name: Check execution (Smoke Test)
run: |
files=$(git ls-files '*.py')
for file in $files; do
echo "Testing execution of $file..."
python "$file" --version || python -m py_compile "$file"
done