Add GitHub Action for Python syntax validation #1
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: Python Syntax Check | |
| on: | |
| pull_request: | |
| branches: | |
| - main # or your default branch | |
| jobs: | |
| syntax-check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['2.7', '3.6', '3.10', '3.12'] # Add more if needed | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Check Python syntax | |
| run: | | |
| find . -name "*.py" -print0 | xargs -0 -n1 python -m py_compile |