30 lines
610 B
YAML
30 lines
610 B
YAML
name: python-syntax
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
syntax-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Syntax check (py_compile)
|
|
run: |
|
|
files=$(git ls-files '*.py')
|
|
if [ -z "$files" ]; then
|
|
echo "No Python files found"
|
|
exit 0
|
|
fi
|
|
python -m py_compile $files
|
|
|
|
- name: Compile all (sanity)
|
|
run: python -m compileall -q server examples
|