name: Validate on: push: branches: [main, develop] pull_request: branches: [main, develop] jobs: # Build + Tests laufen auf allen 3 OS, um Portabilitaet zu zeigen. # Linux ist Pflicht, macOS + Windows sind informell (continue-on-error). # Hintergrund: act_runner host-mode hat Edge-Cases auf Mac (Cache-Pfad) # und Windows (busybox-Bash-Konflikt). Linux-Docker-Mode laeuft sauber. build-test: strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.os != 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ build-essential gcc make cppcheck lcov \ python3 python3-pip ca-certificates - name: Verify toolchain shell: bash run: | which gcc && gcc --version | head -1 which make && make --version | head -1 which cppcheck && cppcheck --version | head -1 - name: Static Analysis (Cppcheck) shell: bash run: make static - name: MISRA Check shell: bash run: | make misra || echo "MISRA findings present (Demo non-failing)" - name: Build + Unit Tests shell: bash run: make test # Coverage, Traceability, PlantUML laufen nur auf Linux (lcov-Tooling, Artifact-Upload). # needs nur auf ubuntu-latest, damit Mac/Win-Failures Reports nicht blockieren. reports: runs-on: ubuntu-latest needs: build-test steps: - name: Checkout uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ build-essential gcc make cppcheck lcov \ python3 python3-pip ca-certificates - name: Build + Tests + Coverage run: | make test make coverage - name: Traceability Check run: python3 tools/traceability.py check - name: Traceability Matrix publishen run: python3 tools/traceability.py publish docs/traceability - name: PlantUML Diagramme rendern run: python3 tools/render_plantuml.py - name: Upload Coverage HTML uses: actions/upload-artifact@v3 if: always() with: name: coverage-html path: build/coverage-html/ - name: Upload Traceability Matrix uses: actions/upload-artifact@v3 if: always() with: name: traceability path: docs/traceability/ - name: Upload Architektur-Diagramme uses: actions/upload-artifact@v3 if: always() with: name: architecture-diagrams path: docs/diagrams/