Skip to content

Commit 51702b7

Browse files
Add Python syntax check workflow
1 parent f1bc4b4 commit 51702b7

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/syntax-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Python Syntax Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main # or your default branch
7+
8+
jobs:
9+
syntax-check:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ['2.7', '3.6', '3.10', '3.12'] # Add more if needed
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Check Python syntax
24+
run: |
25+
find . -name "*.py" -print0 | xargs -0 -n1 python -m py_compile

0 commit comments

Comments
 (0)