name: Validate on: push: branches: [main, develop] pull_request: branches: [main, develop] jobs: # Build + Tests auf allen 3 OS — Linux verbindlich, Mac/Win continue-on-error 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: | set +e echo "PATH=$PATH" gcc --version 2>&1 | head -1 || echo " (kein gcc)" make --version 2>&1 | head -1 || echo " (kein make)" cppcheck --version 2>&1 | head -1 || echo " (kein cppcheck)" echo "done" - 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, Diagrams, API-Doc, Test-Report — alle auf Linux, # parallel zu build-test (Matrix continue-on-error wird leider nicht in needs durchgereicht) reports: runs-on: ubuntu-latest 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 \ doxygen graphviz - name: Build + Tests + Coverage run: | make test make coverage - name: Test-Summary-Report run: make test-report - 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: Doxygen API-Dokumentation run: make docs - name: Landing-Page run: make landing-page - name: Cppcheck-Report (XML) run: | mkdir -p build cppcheck --enable=all --inconclusive --xml --xml-version=2 \ -I src src 2> build/cppcheck-report.xml || true - name: Upload Coverage HTML uses: actions/upload-artifact@v3 if: always() with: name: coverage-html path: build/coverage-html/ - name: Upload Test-Report uses: actions/upload-artifact@v3 if: always() with: name: test-report path: | build/test-report.html build/test-report.md build/test-output.txt - 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/ - name: Upload Doxygen API-Doc uses: actions/upload-artifact@v3 if: always() with: name: api-doc path: build/api-doc/html/ - name: Upload Landing-Page uses: actions/upload-artifact@v3 if: always() with: name: landing-page path: build/index.html - name: Upload Cppcheck-Report uses: actions/upload-artifact@v3 if: always() with: name: cppcheck-report path: build/cppcheck-report.xml - name: Deploy zu gitea.slohmaier.com/pages/demo-epb/ if: success() && github.ref == 'refs/heads/main' run: | DEPLOY=/var/www/pages/demo-epb if [ ! -d "$DEPLOY" ]; then echo "Mount $DEPLOY nicht da — Runner-Config pruefen. Skip." exit 0 fi mkdir -p "$DEPLOY"/{docs,coverage,traceability,diagrams,api-doc,reports,src,misra/records} cp build/index.html "$DEPLOY/index.html" cp -r docs/plaene docs/safety docs/manuals docs/reviews docs/non-conformities "$DEPLOY/docs/" cp -r build/coverage-html/. "$DEPLOY/coverage/" 2>/dev/null || true cp -r docs/traceability/. "$DEPLOY/traceability/" cp -r docs/diagrams/. "$DEPLOY/diagrams/" cp -r build/api-doc/html/. "$DEPLOY/api-doc/" 2>/dev/null || true cp build/test-report.html build/test-report.md "$DEPLOY/reports/" 2>/dev/null || true cp build/cppcheck-report.xml "$DEPLOY/reports/" 2>/dev/null || true cp src/*.c src/*.h "$DEPLOY/src/" cp -r src/stubs "$DEPLOY/src/" 2>/dev/null || true cp -r misra/records/. "$DEPLOY/misra/records/" 2>/dev/null || true echo "https://gitea.slohmaier.com/pages/demo-epb/ updated"