name: XML prüfen

on:
  push:
    paths:
      - 'XML/**/*.xml'
  pull_request:
    paths:
      - 'XML/**/*.xml'

jobs:
  XSD-Schema:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    
    - name: Python-Setup
      uses: actions/setup-python@v5
      with:
        python-version: '3.x'
    
    - name: Abhängigkeiten installieren
      run: |
        python -m pip install --upgrade pip
        pip install lxml
    
    - name: XSD-Schema-Validierung
      run: python Scripts/lint_validation.py
    
    - name: GitHub-Anmerkungen für XSD-Validierung erstellen
      if: failure()
      run: python Scripts/annotations_validation.py
      
  Verweise:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    
    - name: Python-Setup
      uses: actions/setup-python@v5
      with:
        python-version: '3.x'
    
    - name: Abhängigkeiten installieren
      run: |
        python -m pip install --upgrade pip
        pip install lxml
      
    - name: Verweise prüfen 
      run: python Scripts/lint_verweise.py
      
    - name: GitHub-Anmerkungen für Referenzprüfung erstellen
      if: failure()
      run: python Scripts/annotations_references.py
