pull/273/head
RobertGawron 2025-06-24 22:39:12 +02:00
rodzic 718cc260ce
commit f65a74500d
12 zmienionych plików z 11 dodań i 2666 usunięć

Wyświetl plik

@ -97,9 +97,8 @@ jobs:
docker cp $(docker-compose -f docker-compose.yml -f docker-compose.ci.yml ps -q app):/workspace/DevOps/BuildArtifacts/DocsCoverage .
;;
c-static)
docker-compose -f docker-compose.yml -f docker-compose.ci.yml exec -T app bash -c "dos2unix /workspace/ContinuousIntegration/run_c_static_code_analysis.sh && bash /workspace/ContinuousIntegration/run_c_static_code_analysis.sh"
docker cp $(docker-compose -f docker-compose.yml -f docker-compose.ci.yml ps -q app):/workspace/build/C_Lint_ReportApplicationOnly.txt .
docker cp $(docker-compose -f docker-compose.yml -f docker-compose.ci.yml ps -q app):/workspace/build/C_Lint_ReportFull.txt .
docker-compose -f docker-compose.yml -f docker-compose.ci.yml exec -T app bash -c "source /workspace/venv/bin/activate && cd /workspace/build && cmake .. && make cstatic"
docker cp $(docker-compose -f docker-compose.yml -f docker-compose.ci.yml ps -q app):/workspace/DevOps/BuildArtifacts/CStaticAnalysis .
;;
python-static)
docker-compose -f docker-compose.yml -f docker-compose.ci.yml exec -T app bash -c "cd /workspace/build/ && cmake .. && make pystatic"
@ -120,7 +119,7 @@ jobs:
name: ${{ matrix.type }}-artifacts
path: |
${{ matrix.type == 'docs-coverage' && 'DocsCoverage' || '' }}
${{ matrix.type == 'c-static' && 'C_Lint_Report*.txt' || '' }}
${{ matrix.type == 'c-static' && 'CStaticAnalysis' || '' }}
${{ matrix.type == 'python-static' && 'PythonStaticAnalysis' || '' }}
${{ matrix.type == 'firmware' && 'IonizationChamber.*' || '' }}

Wyświetl plik

@ -7,6 +7,7 @@ add_subdirectory(Software/Firmware/UnitTest/)
# Include the DevOps scripts (static code analysis, etc.)
include(DevOps/Cmake/DocsCoverage.cmake)
include(DevOps/Cmake/PythonStaticAnalysis.cmake)
include(DevOps/Cmake/CStaticAnalysis.cmake)
include(DevOps/Cmake/CodeBeautifier.cmake)

Wyświetl plik

@ -1,45 +0,0 @@
# Find the required executables
find_program(HPP2PLANTUML_EXECUTABLE hpp2plantuml)
find_program(PLANTUML_EXECUTABLE plantuml)
if(HPP2PLANTUML_EXECUTABLE AND PLANTUML_EXECUTABLE)
# Set the source directory and output directory for the HPP2PlantUML analysis
set(HPP2PLANTUML_INPUT_DIR "${CMAKE_SOURCE_DIR}/Software/STM32F103RBTx")
set(HPP2PLANTUML_OUTPUT_DIR "${CMAKE_BINARY_DIR}/BuildArtifacts/ClassDiagram")
# Ensure the output directory exists
file(MAKE_DIRECTORY "${HPP2PLANTUML_OUTPUT_DIR}")
# Custom target to generate the PlantUML diagram
add_custom_target(uml
COMMAND ${HPP2PLANTUML_EXECUTABLE}
-d
-i "${HPP2PLANTUML_INPUT_DIR}/Application/*/*/*.hpp"
-i "${HPP2PLANTUML_INPUT_DIR}/Core/Inc/MyApplication.hpp"
-i "${HPP2PLANTUML_INPUT_DIR}/Core/Inc/PlatformFactoryStm32.hpp"
-t ${CMAKE_CURRENT_LIST_DIR}/ClassTemplate.puml
--output ${HPP2PLANTUML_OUTPUT_DIR}/Application.puml
COMMENT "Generating PlantUML class diagrams from all header files recursively..."
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
VERBATIM
)
# Generate SVG from the .puml file
add_custom_command(TARGET uml POST_BUILD
COMMAND ${PLANTUML_EXECUTABLE}
-tsvg -o ${HPP2PLANTUML_OUTPUT_DIR} ${HPP2PLANTUML_OUTPUT_DIR}/Application.puml
COMMENT "Generating SVG diagram from Application.puml..."
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
VERBATIM
)
else()
if(NOT HPP2PLANTUML_EXECUTABLE)
message(FATAL_ERROR "hpp2plantuml not found. Please ensure it is installed and available in your PATH.")
endif()
if(NOT PLANTUML_EXECUTABLE)
message(FATAL_ERROR "plantuml not found. Please ensure it is installed and available in your PATH.")
endif()
endif()

Wyświetl plik

@ -1,3 +0,0 @@
# ContinuousIntegration
This folder contains scripts used by GitHub Continuous Integration. It is recommended to run these scripts locally before submitting a pull request.

Wyświetl plik

@ -1,6 +0,0 @@
#!/bin/bash
# shellcheck disable=SC1091
source /workspace/venv/bin/activate
flake8 --format=html --htmldir=python_lint_report /workspace/Software/MeasurementAcquisition/ /workspace/Simulation

Wyświetl plik

@ -1,3 +0,0 @@
#!/bin/bash
shellcheck /workspace/ContinuousIntegration/*.sh | tee Shell_Script_Lint_Report.txt

Wyświetl plik

@ -83,7 +83,11 @@ RUN /workspace/venv/bin/pip install --upgrade pip && \
RUN apt-get update && apt-get install -y \
uncrustify
RUN apt-get update && apt-get install -y \
clang-tidy
# Command to run the container
CMD ["bash"]

Wyświetl plik

@ -55,6 +55,9 @@ ctest --output-on-failure
clear && rm -rf /workspace/build/* ; cmake .. && make docs
# C static analyse
source /workspace/venv/bin/activate && cd /workspace/build && cmake .. && make cstatic
# Python static analyse

Wyświetl plik

@ -1,19 +0,0 @@
{% extends 'default.puml' %}
{% block preamble %}
' Set the layout direction (left to right or top to bottom)
left to right direction
{% endblock %}
{% block content %}
{% endblock %}
{% block layout %}
' Ensure "Device" is placed below "Driver"
together {
namespace Driver
down
namespace Device
}
{% endblock %}

Wyświetl plik

@ -1,5 +0,0 @@
-*/u8g2/*
-*/stm32-st7735/*
-*/Simulation/FirmwarePCSimulator/ESP8266/Mocks/*
-*/st7735.c
-*/st7735_reg.c

Wyświetl plik

@ -148,22 +148,6 @@ add_custom_target(run_all_tests
COMMENT "Running all unit tests..."
)
# =============================================================================
# STATIC ANALYSIS WITH CODECHECKER
# =============================================================================
find_program(CODECHECKER_PATH CodeChecker)
if(CODECHECKER_PATH)
add_custom_target(static
COMMAND ${CODECHECKER_PATH} analyze ${CMAKE_BINARY_DIR}/compile_commands.json --enable-all --output ${CMAKE_BINARY_DIR}/codechecker_reports
COMMAND ${CODECHECKER_PATH} parse ${CMAKE_BINARY_DIR}/codechecker_reports --export html --output ${CMAKE_BINARY_DIR}/codechecker_html
COMMENT "Running CodeChecker static analysis and exporting HTML report..."
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS run_all_tests
)
else()
message(WARNING "CodeChecker not found! Install with 'pip install --user CodeChecker'")
endif()
# =============================================================================
# CODE COVERAGE CONFIGURATION
# =============================================================================