Files
patreon-downloader/.gitea/workflows/python-syntax.yml
Space-Banane e95f915d86
Some checks failed
Python syntax & lint / syntax-lint (push) Failing after 9s
add Python syntax check and linting workflow
2026-04-06 23:01:19 +02:00

39 lines
947 B
YAML

name: Python syntax & lint
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
syntax-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- 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