Skip to content

Use Azure AI Content Understanding for Enhanced document extraction #510

Use Azure AI Content Understanding for Enhanced document extraction

Use Azure AI Content Understanding for Enhanced document extraction #510

name: Python Syntax Check
on:
pull_request:
branches:
- main
- Development
paths:
- 'application/single_app/**.py'
- '.github/workflows/python-syntax-check.yml'
jobs:
syntax-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
- name: Run Python compilation check
run: |
cd application/single_app
echo "🔍 Running Python compilation checks on all .py files..."
failed_files=()
for file in *.py; do
echo ""
echo "=== Compiling $file ==="
if python -m py_compile "$file" 2>&1; then
echo "✓ $file - OK"
else
echo "✗ $file - FAILED"
failed_files+=("$file")
fi
done
echo ""
echo "================================"
if [ ${#failed_files[@]} -eq 0 ]; then
echo "✅ All Python files compiled successfully!"
exit 0
else
echo "❌ ${#failed_files[@]} file(s) failed compilation:"
printf ' - %s\n' "${failed_files[@]}"
exit 1
fi