name: Vendoo Windows Release Diagnostics

on:
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: vendoo-windows-diagnostics-${{ github.ref }}
  cancel-in-progress: true

jobs:
  windows-release-diagnostics:
    name: Windows – Release-Gates einzeln
    runs-on: windows-latest
    timeout-minutes: 35
    steps:
      - name: Repository auschecken
        uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Node.js 22 aktivieren
        uses: actions/setup-node@v4
        with:
          node-version: '22.x'
          cache: npm

      - name: Abhängigkeiten reproduzierbar installieren
        run: npm ci

      - name: Alle PowerShell-Dateien mit Windows PowerShell 5.1 parsen
        shell: powershell
        run: .\tools\verify-powershell-parser.ps1

      - name: Git-Sicherheitsgate
        run: npm run verify:git

      - name: Git-Sicherheitsgate Regressionstest
        run: npm run verify:git-regression

      - name: Git-Staging-Filter Regressionstest
        run: npm run verify:git-staging

      - name: Release-Manifest prüfen
        run: npm run verify:release-manifest

      - name: Git-Ignore-Grenzen prüfen
        run: npm run verify:ignore-boundaries

      - name: Syntax und Identity-Datenbank prüfen
        run: npm run check

      - name: PowerShell-Regressionen statisch prüfen
        run: npm run verify:powershell-static

      - name: Source-Root-Grenzen prüfen
        run: npm run verify:source-boundaries

      - name: ESM-Exportverträge prüfen
        run: npm run verify:esm-exports

      - name: FLUX-Loop-Hotfix prüfen
        run: npm run verify:flux-loop

      - name: Capability-Graph prüfen
        run: npm run verify:capabilities

      - name: Coolify- und Produktionsoperationen prüfen
        run: npm run verify:coolify

      - name: Initial deaktivierte Module prüfen
        run: npm run verify:initial-modules

      - name: Plattformarchitektur prüfen
        run: npm run verify:architecture

      - name: Theme Manager prüfen
        run: npm run verify:themes

      - name: Security Foundation prüfen
        run: npm run verify:security

      - name: Identity und Settings prüfen
        run: npm run verify:identity

      - name: Einladungen prüfen
        run: npm run verify:invitations

      - name: SQLite-Cleanup unter Windows prüfen
        run: npm run verify:sqlite-cleanup

      - name: Katalog und Medien prüfen
        run: npm run verify:catalog

      - name: Modulmanager prüfen
        run: npm run verify:modules

      - name: Produktionsoperationen prüfen
        run: npm run verify:production-operations

      - name: One-Click-Updater prüfen
        run: npm run verify:one-click-update

      - name: Modulnavigation prüfen
        run: npm run verify:module-navigation

      - name: Updater-UI prüfen
        run: npm run verify:updater-ui

      - name: Updater-Hotfix-Vertrag prüfen
        run: npm run verify:updater-hotfix

      - name: Deployment prüfen
        run: npm run verify:deployment

      - name: Konfigurationsspeicher prüfen
        run: npm run verify:config

      - name: Installer-Shell-Portabilität prüfen
        run: npm run verify:installer-shell

      - name: Datenbankmigrationen prüfen
        run: npm run verify:db
