From 8877324880c47c588f088fa26ba3150f79eedb2d Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:28:59 +0100 Subject: [PATCH 01/62] Update test_unit_cpp.yml --- .github/workflows/{cpp_tests.yml => test_unit_cpp.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cpp_tests.yml => test_unit_cpp.yml} (100%) diff --git a/.github/workflows/cpp_tests.yml b/.github/workflows/test_unit_cpp.yml similarity index 100% rename from .github/workflows/cpp_tests.yml rename to .github/workflows/test_unit_cpp.yml From 4d0452d50621aa86261278eaeca4926e305e32a5 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:30:57 +0100 Subject: [PATCH 02/62] Update publish_jsr.yml --- .github/workflows/publish_jsr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_jsr.yml b/.github/workflows/publish_jsr.yml index b950b12..ae9d457 100644 --- a/.github/workflows/publish_jsr.yml +++ b/.github/workflows/publish_jsr.yml @@ -27,8 +27,8 @@ permissions: jobs: publish-jsr: + name: 'Publish JSR' runs-on: ubuntu-latest - steps: - name: 'Checkout repository' uses: actions/checkout@v4 From e33265476f14d26d08c93ec357ce30a4bf4a6226 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:31:03 +0100 Subject: [PATCH 03/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index cefe01e..93af487 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -1,6 +1,12 @@ name: C++ Tests on: + workflow_call: + inputs: + artifact-name: + required: true + type: string + push: branches: [ main, master ] pull_request: From 972cac522729dfce943ed4b5cb844edf8bead630 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:02:22 +0100 Subject: [PATCH 04/62] Update build_binary.yml --- .github/workflows/build_binary.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 85392a0..96ee620 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -71,10 +71,17 @@ jobs: package_version: ${{ steps.build.outputs.PACKAGE_VERSION }} is_valid_package_version: ${{ steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION }} - trigger-publish: - name: 'Trigger Publish' + test-unit-cpp: + name: 'Test Unit C++' needs: ['build-binary'] - uses: ./.github/workflows/publish_jsr.yml + uses: './.github/workflows/test_unit_cpp.yml' + with: + artifact-name: libcpp_bindings_linux_x86_64 + + publish-jsr: + name: 'Publish JSR' + needs: ['build-binary', 'test-unit-cpp'] + uses: './.github/workflows/publish_jsr.yml' with: publish: ${{ needs.build-binary.outputs.is_valid_package_version == 'true' }} version: ${{ needs.build-binary.outputs.package_version }} From 89d70951a0ea4dd94f98ceb25e2404a3093dc151 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:02:25 +0100 Subject: [PATCH 05/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 83 ++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 93af487..bb9665d 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -1,4 +1,6 @@ -name: C++ Tests +name: 'Test Unit C++' +description: | + This workflow runs the unit tests. on: workflow_call: @@ -7,52 +9,83 @@ on: required: true type: string - push: - branches: [ main, master ] - pull_request: - jobs: - cpp-tests: - name: C++ tests (gcc) + test-unit-cpp: + name: 'Test Unit C++' runs-on: ubuntu-latest - - container: - image: fedora:43 - env: - SERIAL_TEST_PORT: /tmp/ttyCI_A + SERIAL_TEST_PORT_A: /tmp/ttyCI_A + SERIAL_TEST_PORT_B: /tmp/ttyCI_B + TEST_REPORT_NAME: 'test_report.xml' steps: - - name: Checkout repository + - name: 'Checkout repository' uses: actions/checkout@v4 - - name: Install build dependencies (gcc) + - name: 'Setup GCC' + uses: egor-tensin/setup-gcc@v2 + with: + version: '14' + platform: 'x64' + + - name: 'Setup CMake' + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.31.x' + + - name: 'Download artifact' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact-name }} + path: 'artifacts' + + - name: 'Install test dependencies' run: | - dnf -y update - dnf -y install cmake ninja-build gcc-c++ socat git + apt-get install -y socat - - name: Configure CMake + - name: 'Configure CMake' env: CXX: g++ + run: | - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ + -DUSE_PREBUILT_LIB=ON \ + -DPREBUILT_LIB_DIR=$GITHUB_WORKSPACE/artifacts - - name: Build + - name: 'Build tests' run: | cmake --build build --config Release - name: Start virtual serial echo (socat) run: | - socat -d -d pty,raw,echo=0,link=/tmp/ttyCI_A,mode=666 pty,raw,echo=0,link=/tmp/ttyCI_B,mode=666 & + socat -d -d pty,raw,echo=0,link=$SERIAL_TEST_PORT_A,mode=666 pty,raw,echo=0,link=$SERIAL_TEST_PORT_B,mode=666 & sleep 2 - stdbuf -i0 -o0 cat < /tmp/ttyCI_B > /tmp/ttyCI_B & + stdbuf -i0 -o0 cat < $SERIAL_TEST_PORT_B > $SERIAL_TEST_PORT_B & sleep 1 - - name: Run C++ unit/integration tests - working-directory: build + - name: 'Run tests' + working-directory: 'build' env: - SERIAL_TEST_PORT: /tmp/ttyCI_A + LD_LIBRARY_PATH: $GITHUB_WORKSPACE/artifacts + run: | - ./cpp_bindings_linux_tests --gtest_color=yes + ./cpp_bindings_linux_tests + --gtest_color=yes + --gtest_output=xml:$TEST_REPORT_NAME + + - name: 'Upload test results' + if: always() + uses: actions/upload-artifact@v4 + with: + name: 'test_results' + path: 'build/${{ env.TEST_REPORT_NAME }}' + + - name: 'Publish test report' + if: always() + uses: dorny/test-reporter@v1 + with: + name: 'C++ Unit Tests' + path: 'build/${{ env.TEST_REPORT_NAME }}' + reporter: java-junit From dd79599e5340929bc72962725e58b71192b55bb7 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:03:07 +0100 Subject: [PATCH 06/62] Update build_binary.yml --- .github/workflows/build_binary.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 96ee620..a367bd3 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -77,6 +77,9 @@ jobs: uses: './.github/workflows/test_unit_cpp.yml' with: artifact-name: libcpp_bindings_linux_x86_64 + + permissions: + contents: read publish-jsr: name: 'Publish JSR' From b5833c9f0bf500eb41021cc21d27894842a2e9f0 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:05:21 +0100 Subject: [PATCH 07/62] Update build_binary.yml --- .github/workflows/build_binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index a367bd3..72fa729 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -72,7 +72,7 @@ jobs: is_valid_package_version: ${{ steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION }} test-unit-cpp: - name: 'Test Unit C++' + name: 'Run: Test Unit C++' needs: ['build-binary'] uses: './.github/workflows/test_unit_cpp.yml' with: @@ -82,7 +82,7 @@ jobs: contents: read publish-jsr: - name: 'Publish JSR' + name: 'Run: Publish JSR' needs: ['build-binary', 'test-unit-cpp'] uses: './.github/workflows/publish_jsr.yml' with: From ffc0045c760cf43d10f42f6a98cf942d147b3324 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:09:07 +0100 Subject: [PATCH 08/62] fix: sudo --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index bb9665d..03b1fcf 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -41,7 +41,7 @@ jobs: - name: 'Install test dependencies' run: | - apt-get install -y socat + sudo apt-get install -y socat - name: 'Configure CMake' env: From 481853544735d5287d192597f4070671fa702336 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:21:57 +0100 Subject: [PATCH 09/62] fix: Change CMake for using prebuild --- CMakeLists.txt | 61 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b17a2a1..2aa4d22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ project( LANGUAGES CXX ) +option(USE_PREBUILT_LIB "Use prebuilt cpp_bindings_linux library" OFF) +set(PREBUILT_LIB_DIR "" CACHE PATH "Directory containing prebuilt libcpp_bindings_linux.so") + file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "PACKAGE_VERSION=${GIT_DESCRIBE_NO_V}") # Set C++ standard @@ -62,31 +65,47 @@ file(GLOB_RECURSE LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") list(FILTER LIB_SOURCES EXCLUDE REGEX ".*\\.test\\.cpp$") list(FILTER LIB_SOURCES EXCLUDE REGEX ".*/test_helpers/.*") -add_library(cpp_bindings_linux SHARED ${LIB_SOURCES}) +if(USE_PREBUILT_LIB) + message(STATUS "Using prebuilt cpp_bindings_linux from ${PREBUILT_LIB_DIR}") -set_target_properties( - cpp_bindings_linux - PROPERTIES - VERSION "${GIT_VERSION_MAJOR}.${GIT_VERSION_MINOR}.${GIT_VERSION_PATCH}" - SOVERSION "${GIT_VERSION_MAJOR}" - OUTPUT_NAME cpp_bindings_linux -) + add_library(cpp_bindings_linux SHARED IMPORTED) -target_include_directories( - cpp_bindings_linux - PUBLIC - $ - $ - $ -) + set_target_properties( + cpp_bindings_linux + PROPERTIES + IMPORTED_LOCATION "${PREBUILT_LIB_DIR}/libcpp_bindings_linux.so" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include;${CMAKE_BINARY_DIR}/generated" + ) -target_link_libraries( - cpp_bindings_linux - PUBLIC - cpp_core::cpp_core -) +else() + message(STATUS "Building cpp_bindings_linux from source") + + add_library(cpp_bindings_linux SHARED ${LIB_SOURCES}) -target_compile_features(cpp_bindings_linux PUBLIC cxx_std_23) + set_target_properties( + cpp_bindings_linux + PROPERTIES + VERSION "${GIT_VERSION_MAJOR}.${GIT_VERSION_MINOR}.${GIT_VERSION_PATCH}" + SOVERSION "${GIT_VERSION_MAJOR}" + OUTPUT_NAME cpp_bindings_linux + ) + + target_include_directories( + cpp_bindings_linux + PUBLIC + $ + $ + $ + ) + + target_link_libraries( + cpp_bindings_linux + PUBLIC + cpp_core::cpp_core + ) + + target_compile_features(cpp_bindings_linux PUBLIC cxx_std_23) +endif() # Test sources: src/*.test.cpp, tests/*.test.cpp, src/test_helpers/*.cpp (helpers excluded from lib) file(GLOB SRC_UNIT_TESTS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.test.cpp") From f6fada63c9763f4b5f10cbfdb39a7cefb870f512 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:22:34 +0100 Subject: [PATCH 10/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 03b1fcf..f44bae5 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -48,7 +48,8 @@ jobs: CXX: g++ run: | - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \ + cmake -S . -B build -G Ninja + -DCMAKE_BUILD_TYPE=Release \ -DUSE_PREBUILT_LIB=ON \ -DPREBUILT_LIB_DIR=$GITHUB_WORKSPACE/artifacts From 4bea5391e5fd3d4c1b6684fa5a06981084dbdc04 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:38:22 +0100 Subject: [PATCH 11/62] fix: env --- .github/workflows/test_unit_cpp.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index f44bae5..e42365a 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -14,8 +14,8 @@ jobs: name: 'Test Unit C++' runs-on: ubuntu-latest env: - SERIAL_TEST_PORT_A: /tmp/ttyCI_A - SERIAL_TEST_PORT_B: /tmp/ttyCI_B + SERIAL_TEST_PORT_IN: /tmp/ttyCI_IN + SERIAL_TEST_PORT_OUT: /tmp/ttyCI_OUT TEST_REPORT_NAME: 'test_report.xml' steps: @@ -59,14 +59,15 @@ jobs: - name: Start virtual serial echo (socat) run: | - socat -d -d pty,raw,echo=0,link=$SERIAL_TEST_PORT_A,mode=666 pty,raw,echo=0,link=$SERIAL_TEST_PORT_B,mode=666 & + socat -d -d pty,raw,echo=0,link=$SERIAL_TEST_PORT_IN,mode=666 pty,raw,echo=0,link=$SERIAL_TEST_PORT_OUT,mode=666 & sleep 2 - stdbuf -i0 -o0 cat < $SERIAL_TEST_PORT_B > $SERIAL_TEST_PORT_B & + stdbuf -i0 -o0 cat < $SERIAL_TEST_PORT_OUT > $SERIAL_TEST_PORT_OUT & sleep 1 - name: 'Run tests' working-directory: 'build' env: + SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN LD_LIBRARY_PATH: $GITHUB_WORKSPACE/artifacts run: | From b0fedd1e37bc2b68238a85c0044f7b942e9cec29 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 11:41:13 +0100 Subject: [PATCH 12/62] fix: missing \ --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index e42365a..fba8f07 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -48,7 +48,7 @@ jobs: CXX: g++ run: | - cmake -S . -B build -G Ninja + cmake -S . -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DUSE_PREBUILT_LIB=ON \ -DPREBUILT_LIB_DIR=$GITHUB_WORKSPACE/artifacts From 11c79fa31ea2a3dafc57d03ee5a5e8067b0adb98 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:14:47 +0100 Subject: [PATCH 13/62] fix: revert --- CMakeLists.txt | 61 +++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aa4d22..b17a2a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,6 @@ project( LANGUAGES CXX ) -option(USE_PREBUILT_LIB "Use prebuilt cpp_bindings_linux library" OFF) -set(PREBUILT_LIB_DIR "" CACHE PATH "Directory containing prebuilt libcpp_bindings_linux.so") - file(WRITE "${CMAKE_BINARY_DIR}/env.sh" "PACKAGE_VERSION=${GIT_DESCRIBE_NO_V}") # Set C++ standard @@ -65,47 +62,31 @@ file(GLOB_RECURSE LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") list(FILTER LIB_SOURCES EXCLUDE REGEX ".*\\.test\\.cpp$") list(FILTER LIB_SOURCES EXCLUDE REGEX ".*/test_helpers/.*") -if(USE_PREBUILT_LIB) - message(STATUS "Using prebuilt cpp_bindings_linux from ${PREBUILT_LIB_DIR}") +add_library(cpp_bindings_linux SHARED ${LIB_SOURCES}) - add_library(cpp_bindings_linux SHARED IMPORTED) +set_target_properties( + cpp_bindings_linux + PROPERTIES + VERSION "${GIT_VERSION_MAJOR}.${GIT_VERSION_MINOR}.${GIT_VERSION_PATCH}" + SOVERSION "${GIT_VERSION_MAJOR}" + OUTPUT_NAME cpp_bindings_linux +) - set_target_properties( - cpp_bindings_linux - PROPERTIES - IMPORTED_LOCATION "${PREBUILT_LIB_DIR}/libcpp_bindings_linux.so" - INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include;${CMAKE_BINARY_DIR}/generated" - ) +target_include_directories( + cpp_bindings_linux + PUBLIC + $ + $ + $ +) -else() - message(STATUS "Building cpp_bindings_linux from source") - - add_library(cpp_bindings_linux SHARED ${LIB_SOURCES}) +target_link_libraries( + cpp_bindings_linux + PUBLIC + cpp_core::cpp_core +) - set_target_properties( - cpp_bindings_linux - PROPERTIES - VERSION "${GIT_VERSION_MAJOR}.${GIT_VERSION_MINOR}.${GIT_VERSION_PATCH}" - SOVERSION "${GIT_VERSION_MAJOR}" - OUTPUT_NAME cpp_bindings_linux - ) - - target_include_directories( - cpp_bindings_linux - PUBLIC - $ - $ - $ - ) - - target_link_libraries( - cpp_bindings_linux - PUBLIC - cpp_core::cpp_core - ) - - target_compile_features(cpp_bindings_linux PUBLIC cxx_std_23) -endif() +target_compile_features(cpp_bindings_linux PUBLIC cxx_std_23) # Test sources: src/*.test.cpp, tests/*.test.cpp, src/test_helpers/*.cpp (helpers excluded from lib) file(GLOB SRC_UNIT_TESTS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.test.cpp") From 83ea45bcd880dfeb2f3dab6f388b51698074e4e3 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:28:35 +0100 Subject: [PATCH 14/62] fix: upload test artifacts --- .github/workflows/build_binary.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 72fa729..8cb1635 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -42,7 +42,7 @@ jobs: - name: 'Build' id: 'build' run: | - cmake --build build --config Release + cmake --build build --config Release --target all . build/env.sh echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT @@ -51,7 +51,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: libcpp_bindings_linux_x86_64 - path: build/libcpp_bindings_linux.so* + path: | + build/libcpp_bindings_linux.so* + build/cpp_bindings_linux_tests - name: 'Check tag' id: 'check-tag' From 2f088727a2b948db9f271ec283a3c9bb2612cad5 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:35:22 +0100 Subject: [PATCH 15/62] fix: Remove build step --- .github/workflows/build_binary.yml | 16 ++++++++++------ .github/workflows/test_unit_cpp.yml | 25 ------------------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 8cb1635..7a0fb21 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -50,10 +50,14 @@ jobs: - name: 'Upload artifacts' uses: actions/upload-artifact@v4 with: - name: libcpp_bindings_linux_x86_64 - path: | - build/libcpp_bindings_linux.so* - build/cpp_bindings_linux_tests + name: libcpp_bindings_linux + path: build/libcpp_bindings_linux.so* + + - name: 'Upload artifacts' + uses: actions/upload-artifact@v4 + with: + name: cpp_bindings_linux_tests + path: build/cpp_bindings_linux_tests - name: 'Check tag' id: 'check-tag' @@ -78,7 +82,7 @@ jobs: needs: ['build-binary'] uses: './.github/workflows/test_unit_cpp.yml' with: - artifact-name: libcpp_bindings_linux_x86_64 + artifact-name: cpp_bindings_linux_test permissions: contents: read @@ -90,7 +94,7 @@ jobs: with: publish: ${{ needs.build-binary.outputs.is_valid_package_version == 'true' }} version: ${{ needs.build-binary.outputs.package_version }} - artifact-name: libcpp_bindings_linux_x86_64 + artifact-name: libcpp_bindings_linux permissions: contents: read diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index fba8f07..23ef1be 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -21,17 +21,6 @@ jobs: steps: - name: 'Checkout repository' uses: actions/checkout@v4 - - - name: 'Setup GCC' - uses: egor-tensin/setup-gcc@v2 - with: - version: '14' - platform: 'x64' - - - name: 'Setup CMake' - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: '3.31.x' - name: 'Download artifact' uses: actions/download-artifact@v4 @@ -43,20 +32,6 @@ jobs: run: | sudo apt-get install -y socat - - name: 'Configure CMake' - env: - CXX: g++ - - run: | - cmake -S . -B build -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DUSE_PREBUILT_LIB=ON \ - -DPREBUILT_LIB_DIR=$GITHUB_WORKSPACE/artifacts - - - name: 'Build tests' - run: | - cmake --build build --config Release - - name: Start virtual serial echo (socat) run: | socat -d -d pty,raw,echo=0,link=$SERIAL_TEST_PORT_IN,mode=666 pty,raw,echo=0,link=$SERIAL_TEST_PORT_OUT,mode=666 & From ff7ac9c575131545a804dcf9e81fe8041a0645bb Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:37:38 +0100 Subject: [PATCH 16/62] fix: error if no files --- .github/workflows/build_binary.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 7a0fb21..fefbcc2 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -47,15 +47,17 @@ jobs: . build/env.sh echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT - - name: 'Upload artifacts' + - name: 'Upload artifacts (lib)' uses: actions/upload-artifact@v4 with: + if-no-files-found: error name: libcpp_bindings_linux path: build/libcpp_bindings_linux.so* - - name: 'Upload artifacts' + - name: 'Upload artifacts (tests)' uses: actions/upload-artifact@v4 with: + if-no-files-found: error name: cpp_bindings_linux_tests path: build/cpp_bindings_linux_tests From 580176465f08e42b15fe4e5e82f2d9c16b655389 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:38:59 +0100 Subject: [PATCH 17/62] Update build_binary.yml --- .github/workflows/build_binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index fefbcc2..43f6ae7 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -84,7 +84,7 @@ jobs: needs: ['build-binary'] uses: './.github/workflows/test_unit_cpp.yml' with: - artifact-name: cpp_bindings_linux_test + artifact-name: cpp_bindings_linux_tests permissions: contents: read From 6e00b85f0c8f5101299f3f0fa2e9d2bc4d28392d Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:42:56 +0100 Subject: [PATCH 18/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 23ef1be..40be3e0 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -40,10 +40,9 @@ jobs: sleep 1 - name: 'Run tests' - working-directory: 'build' + working-directory: 'artifacts' env: SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN - LD_LIBRARY_PATH: $GITHUB_WORKSPACE/artifacts run: | ./cpp_bindings_linux_tests From 7e7569e73d3620747448fac2fc84c0e32ade56b5 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:46:49 +0100 Subject: [PATCH 19/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 40be3e0..21e448a 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -45,11 +45,13 @@ jobs: SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN run: | + chmod +x ./cpp_bindings_linux_tests + ./cpp_bindings_linux_tests --gtest_color=yes --gtest_output=xml:$TEST_REPORT_NAME - - name: 'Upload test results' + - name: 'Upload test report' if: always() uses: actions/upload-artifact@v4 with: From 28da40c7c0293b5086b680cd198b600e95699d02 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:55:52 +0100 Subject: [PATCH 20/62] fix: artifacts --- .github/workflows/build_binary.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 43f6ae7..476a940 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -52,14 +52,16 @@ jobs: with: if-no-files-found: error name: libcpp_bindings_linux - path: build/libcpp_bindings_linux.so* + path: build/libcpp_bindings_linux.so - name: 'Upload artifacts (tests)' uses: actions/upload-artifact@v4 with: if-no-files-found: error name: cpp_bindings_linux_tests - path: build/cpp_bindings_linux_tests + path: | + build/libcpp_bindings_linux.so* + build/cpp_bindings_linux_tests - name: 'Check tag' id: 'check-tag' From cb2c1259edc3a7b7653c6e8611f3634e58b082c1 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:02:36 +0100 Subject: [PATCH 21/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 21e448a..22cdaf4 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -45,6 +45,7 @@ jobs: SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN run: | + ls -R . chmod +x ./cpp_bindings_linux_tests ./cpp_bindings_linux_tests From a79183dcf619c6832f66434d09297467eb74bf6e Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:06:44 +0100 Subject: [PATCH 22/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 22cdaf4..de88b76 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -42,6 +42,7 @@ jobs: - name: 'Run tests' working-directory: 'artifacts' env: + LD_LIBRARY_PATH: './libcpp_bindings_linux.so' SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN run: | From 4135d2848af454969541877d01cdfaf374035ef7 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:11:49 +0100 Subject: [PATCH 23/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index de88b76..747632c 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -42,11 +42,11 @@ jobs: - name: 'Run tests' working-directory: 'artifacts' env: - LD_LIBRARY_PATH: './libcpp_bindings_linux.so' + LD_LIBRARY_PATH: '$GITHUB_WORKSPACE/artifacts' SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN run: | - ls -R . + ls -Ral . chmod +x ./cpp_bindings_linux_tests ./cpp_bindings_linux_tests From cf037c6c8bbcc33d18b940faf5a0753215c4beca Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:14:31 +0100 Subject: [PATCH 24/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 747632c..84cc5bf 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -42,7 +42,7 @@ jobs: - name: 'Run tests' working-directory: 'artifacts' env: - LD_LIBRARY_PATH: '$GITHUB_WORKSPACE/artifacts' + LD_LIBRARY_PATH: '${{ github.workspace }}/artifacts' SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN run: | From 86fa530e97f3507b7b99d3a941f3cf27ba30336b Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:15:20 +0100 Subject: [PATCH 25/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 84cc5bf..f158035 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -46,6 +46,7 @@ jobs: SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN run: | + pwd ls -Ral . chmod +x ./cpp_bindings_linux_tests From ac2b77b008cde25f0998d239de0c8c0f4def59d9 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:19:47 +0100 Subject: [PATCH 26/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index f158035..bdeab07 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -43,7 +43,7 @@ jobs: working-directory: 'artifacts' env: LD_LIBRARY_PATH: '${{ github.workspace }}/artifacts' - SERIAL_TEST_PORT: $SERIAL_TEST_PORT_IN + SERIAL_TEST_PORT: '${{ env.SERIAL_TEST_PORT_IN }}' run: | pwd From b3fc9a21395cb0a5d2a4f2803520cc961a0b0346 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:20:16 +0100 Subject: [PATCH 27/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index bdeab07..11a00b0 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -46,8 +46,6 @@ jobs: SERIAL_TEST_PORT: '${{ env.SERIAL_TEST_PORT_IN }}' run: | - pwd - ls -Ral . chmod +x ./cpp_bindings_linux_tests ./cpp_bindings_linux_tests From 275a4048828452b2a7912a02a487248b153f5da7 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:26:58 +0100 Subject: [PATCH 28/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 11a00b0..d9b8276 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -48,8 +48,8 @@ jobs: run: | chmod +x ./cpp_bindings_linux_tests - ./cpp_bindings_linux_tests - --gtest_color=yes + ./cpp_bindings_linux_tests \ + --gtest_color=yes \ --gtest_output=xml:$TEST_REPORT_NAME - name: 'Upload test report' From 3c9ebcb5a2a75accf0103321ca27f69b4425b80c Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:27:42 +0100 Subject: [PATCH 29/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index d9b8276..59291bb 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -57,14 +57,14 @@ jobs: uses: actions/upload-artifact@v4 with: name: 'test_results' - path: 'build/${{ env.TEST_REPORT_NAME }}' + path: 'artifacts/${{ env.TEST_REPORT_NAME }}' - name: 'Publish test report' if: always() uses: dorny/test-reporter@v1 with: name: 'C++ Unit Tests' - path: 'build/${{ env.TEST_REPORT_NAME }}' + path: 'artifacts/${{ env.TEST_REPORT_NAME }}' reporter: java-junit From 11778d7dad34bc47c9228ebc931f460f8c61fd3b Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:30:58 +0100 Subject: [PATCH 30/62] Update build_binary.yml --- .github/workflows/build_binary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 476a940..eec0035 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -90,6 +90,7 @@ jobs: permissions: contents: read + checks: write publish-jsr: name: 'Run: Publish JSR' From 66a89dff53ee1e0fffda042cb25eb7fb22c15de6 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:41:39 +0100 Subject: [PATCH 31/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 59291bb..0af77b8 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -61,10 +61,9 @@ jobs: - name: 'Publish test report' if: always() - uses: dorny/test-reporter@v1 + uses: mikepenz/action-junit-report@v5 with: - name: 'C++ Unit Tests' - path: 'artifacts/${{ env.TEST_REPORT_NAME }}' - reporter: java-junit + report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' + detailed_summary: true From cb468229033a145a33cb20f16def61fa4985e514 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:45:32 +0100 Subject: [PATCH 32/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 0af77b8..2c1a91d 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -65,5 +65,8 @@ jobs: with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' detailed_summary: true + include_passed: true + annotate_notice: true + From 956ae95268ff58588270ed841be1540d20466b62 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:49:46 +0100 Subject: [PATCH 33/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 2c1a91d..75430ae 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -67,6 +67,7 @@ jobs: detailed_summary: true include_passed: true annotate_notice: true + group_suite: true From 09913d57ae00e56a2d9db6d83f604a586ea4ee1f Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:53:58 +0100 Subject: [PATCH 34/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 75430ae..0c179d2 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -65,7 +65,6 @@ jobs: with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' detailed_summary: true - include_passed: true annotate_notice: true group_suite: true From 0cc87d0e5cc8ff920562620735a7b1cbe5d9cef2 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:57:17 +0100 Subject: [PATCH 35/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 0c179d2..29b1d35 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -64,7 +64,9 @@ jobs: uses: mikepenz/action-junit-report@v5 with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' + # check_title_template: '' detailed_summary: true + include_passed: true annotate_notice: true group_suite: true From e2f2285524ac107182a1e7b142e2fd376b5e0bb9 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:08:04 +0100 Subject: [PATCH 36/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 29b1d35..e6c78b8 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -64,11 +64,11 @@ jobs: uses: mikepenz/action-junit-report@v5 with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' - # check_title_template: '' + check_title_template: '' detailed_summary: true + group_suite: true include_passed: true annotate_notice: true - group_suite: true From 8d7a7d85dd5d07f97df69c29feb7123da0523884 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:08:37 +0100 Subject: [PATCH 37/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index e6c78b8..d0b1b54 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -64,7 +64,7 @@ jobs: uses: mikepenz/action-junit-report@v5 with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' - check_title_template: '' + check_title_template: '{{FILE_NAME}}, {{SUITE_NAME}}, {{TEST_NAME}}, {{CLASS_NAME}}, {{BREAD_CRUMB}}' detailed_summary: true group_suite: true include_passed: true From 5002721abb5ea7e1606fb8d0593f22117c55289b Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:12:53 +0100 Subject: [PATCH 38/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index d0b1b54..d12164b 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -64,7 +64,7 @@ jobs: uses: mikepenz/action-junit-report@v5 with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' - check_title_template: '{{FILE_NAME}}, {{SUITE_NAME}}, {{TEST_NAME}}, {{CLASS_NAME}}, {{BREAD_CRUMB}}' + check_title_template: '`{{FILE_NAME}} -> {{TEST_NAME}}`' detailed_summary: true group_suite: true include_passed: true From f6c49d391da77b19a9c17c8cb57f8baf3b35dc2f Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:17:56 +0100 Subject: [PATCH 39/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index d12164b..ec5c70b 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -64,7 +64,7 @@ jobs: uses: mikepenz/action-junit-report@v5 with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' - check_title_template: '`{{FILE_NAME}} -> {{TEST_NAME}}`' + check_title_template: '
{{FILE_NAME}} -> {{TEST_NAME}}
' detailed_summary: true group_suite: true include_passed: true From fe86433907a9aece9212b479fd0108314d1fde53 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:20:57 +0100 Subject: [PATCH 40/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index ec5c70b..7cbbd2d 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -69,6 +69,8 @@ jobs: group_suite: true include_passed: true annotate_notice: true + transformers: | + [{"searchValue": "${{ github.workspace }}", "replaceValue": ""}] From ef1177863f08d13833f5bdaf14890520cc37bbad Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:21:54 +0100 Subject: [PATCH 41/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 7cbbd2d..6dbdcf3 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -69,6 +69,7 @@ jobs: group_suite: true include_passed: true annotate_notice: true + test_files_prefix: '/' transformers: | [{"searchValue": "${{ github.workspace }}", "replaceValue": ""}] From 60fb1d7a39f1420291a30442c9e36cae565e1446 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:26:35 +0100 Subject: [PATCH 42/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 6dbdcf3..fc68d31 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -71,7 +71,7 @@ jobs: annotate_notice: true test_files_prefix: '/' transformers: | - [{"searchValue": "${{ github.workspace }}", "replaceValue": ""}] + [{"searchValue": "/home/runner/work/cpp-bindings-linux", "replaceValue": ""}] From 1e766e2d01df113641c73b4dfe607acd474386a0 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:29:42 +0100 Subject: [PATCH 43/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index fc68d31..3f96e8f 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -64,12 +64,10 @@ jobs: uses: mikepenz/action-junit-report@v5 with: report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' - check_title_template: '
{{FILE_NAME}} -> {{TEST_NAME}}
' detailed_summary: true group_suite: true include_passed: true annotate_notice: true - test_files_prefix: '/' transformers: | [{"searchValue": "/home/runner/work/cpp-bindings-linux", "replaceValue": ""}] From 8d8bc726b4d6dd406c8ab8322276d960a81d0279 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:32:34 +0100 Subject: [PATCH 44/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 3f96e8f..eca1859 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -68,8 +68,7 @@ jobs: group_suite: true include_passed: true annotate_notice: true - transformers: | - [{"searchValue": "/home/runner/work/cpp-bindings-linux", "replaceValue": ""}] + transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' From cb59b8064e6993210faf5ba871b073e5ef6d26ab Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:36:03 +0100 Subject: [PATCH 45/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index eca1859..2a2b2d1 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -56,7 +56,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: 'test_results' + name: 'test_reports' path: 'artifacts/${{ env.TEST_REPORT_NAME }}' - name: 'Publish test report' @@ -68,7 +68,7 @@ jobs: group_suite: true include_passed: true annotate_notice: true - transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' + transformers: '[{"searchValue":"/home/runner/work/cpp-bindings-linux","replaceValue":""}]' From 771141caf3cc11babb3afdbf94d5387eccd81e25 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:40:57 +0100 Subject: [PATCH 46/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 2a2b2d1..fe0f1b0 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -68,7 +68,7 @@ jobs: group_suite: true include_passed: true annotate_notice: true - transformers: '[{"searchValue":"/home/runner/work/cpp-bindings-linux","replaceValue":""}]' + transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' From 8a50f3b1de0ff8fa592297131e22b6f1c592ac86 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:44:26 +0100 Subject: [PATCH 47/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index fe0f1b0..305c753 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -69,6 +69,7 @@ jobs: include_passed: true annotate_notice: true transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' + check_title_template: '{{FILE_NAME}} {{TEST_NAME}}' From 3a7a1c7a2a76ccf2db53502e8a7565df5d8a660c Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:59:45 +0100 Subject: [PATCH 48/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 305c753..03d8cd0 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -69,7 +69,7 @@ jobs: include_passed: true annotate_notice: true transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' - check_title_template: '{{FILE_NAME}} {{TEST_NAME}}' + check_title_template: '{{FILE_NAME}} | {{TEST_NAME}}' From 4a53362a4cb76c7a458149feecb370d2c2a97a89 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:04:45 +0100 Subject: [PATCH 49/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 03d8cd0..4eeb851 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -68,7 +68,7 @@ jobs: group_suite: true include_passed: true annotate_notice: true - transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' + transformers: '[{"searchValue": "\/", "replaceValue": ""}]' check_title_template: '{{FILE_NAME}} | {{TEST_NAME}}' From e1d443b00b784fdb6d4b377acfd6ad5d7360c563 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Fri, 30 Jan 2026 15:18:54 +0100 Subject: [PATCH 50/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 4eeb851..03d8cd0 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -68,7 +68,7 @@ jobs: group_suite: true include_passed: true annotate_notice: true - transformers: '[{"searchValue": "\/", "replaceValue": ""}]' + transformers: '[{"searchValue": "${{ github.workspace }}", "replaceValue": ""}]' check_title_template: '{{FILE_NAME}} | {{TEST_NAME}}' From 90c545edafcd611dd4c9e5729b251fbc91656287 Mon Sep 17 00:00:00 2001 From: Mqxx <62719703+Mqxx@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:28:04 +0100 Subject: [PATCH 51/62] feat: code coverage annotations --- .github/workflows/build_binary.yml | 11 ++++++++ .github/workflows/code_coverage_cpp.yml | 35 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/code_coverage_cpp.yml diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index eec0035..6037fa5 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -91,6 +91,17 @@ jobs: permissions: contents: read checks: write + + code-coverage-cpp: + name: 'Run: CodeCoverage C++' + needs: ['build-binary'] + uses: './.github/workflows/code_coverage_cpp.yml' + with: + artifact-name: cpp_bindings_linux_tests + + permissions: + contents: read + checks: write publish-jsr: name: 'Run: Publish JSR' diff --git a/.github/workflows/code_coverage_cpp.yml b/.github/workflows/code_coverage_cpp.yml new file mode 100644 index 0000000..a19b535 --- /dev/null +++ b/.github/workflows/code_coverage_cpp.yml @@ -0,0 +1,35 @@ +name: 'Code Coverage C++' +description: | + This workflow checks and displays code coverage. + +on: + workflow_call: + inputs: + artifact-name: + required: true + type: string + +jobs: + code-coverage-cpp: + name: 'Code Coverage C++' + runs-on: ubuntu-latest + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v4 + + - name: 'Download artifact' + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.artifact-name }} + path: 'artifacts' + + - name: 'Code Coverage Annotation' + uses: ggilder/codecoverage@v1 + with: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + COVERAGE_FILE_PATH: "./artifacts/lcov.info" + COVERAGE_FORMAT: "lcov" + + + From 709357d5faeba33bf470cc0e68ac6156ae3ae445 Mon Sep 17 00:00:00 2001 From: Katze719 Date: Thu, 12 Feb 2026 17:25:54 +0100 Subject: [PATCH 52/62] feat: add CMake presets for build configurations and update code coverage workflow --- .github/workflows/build_binary.yml | 1 - .github/workflows/code_coverage_cpp.yml | 64 +++++++++++++++++++++---- CMakePresets.json | 46 ++++++++++++++++++ 3 files changed, 100 insertions(+), 11 deletions(-) create mode 100644 CMakePresets.json diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 6037fa5..89963f0 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -94,7 +94,6 @@ jobs: code-coverage-cpp: name: 'Run: CodeCoverage C++' - needs: ['build-binary'] uses: './.github/workflows/code_coverage_cpp.yml' with: artifact-name: cpp_bindings_linux_tests diff --git a/.github/workflows/code_coverage_cpp.yml b/.github/workflows/code_coverage_cpp.yml index a19b535..6e6c076 100644 --- a/.github/workflows/code_coverage_cpp.yml +++ b/.github/workflows/code_coverage_cpp.yml @@ -13,23 +13,67 @@ jobs: code-coverage-cpp: name: 'Code Coverage C++' runs-on: ubuntu-latest + env: + SERIAL_TEST_PORT_IN: /tmp/ttyCI_IN + SERIAL_TEST_PORT_OUT: /tmp/ttyCI_OUT steps: - name: 'Checkout repository' uses: actions/checkout@v4 - - - name: 'Download artifact' - uses: actions/download-artifact@v4 with: - name: ${{ inputs.artifact-name }} - path: 'artifacts' + fetch-depth: 0 - - name: 'Code Coverage Annotation' - uses: ggilder/codecoverage@v1 + - name: 'Setup Clang' + uses: egor-tensin/setup-clang@v2 + with: + version: '21' + platform: 'x64' + + - name: 'Setup CMake' + uses: jwlawson/actions-setup-cmake@v2 with: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - COVERAGE_FILE_PATH: "./artifacts/lcov.info" - COVERAGE_FORMAT: "lcov" + cmake-version: '3.31.x' + + - name: 'Configure CMake (coverage preset)' + run: cmake --preset coverage + + - name: 'Build' + run: cmake --build --preset coverage + - name: 'Install test dependencies' + run: sudo apt-get install -y socat + - name: 'Start virtual serial echo (socat)' + run: | + socat -d -d pty,raw,echo=0,link=$SERIAL_TEST_PORT_IN,mode=666 pty,raw,echo=0,link=$SERIAL_TEST_PORT_OUT,mode=666 & + sleep 2 + stdbuf -i0 -o0 cat < $SERIAL_TEST_PORT_OUT > $SERIAL_TEST_PORT_OUT & + sleep 1 + - name: 'Run tests with coverage' + working-directory: build + env: + LD_LIBRARY_PATH: '${{ github.workspace }}/build' + SERIAL_TEST_PORT: '${{ env.SERIAL_TEST_PORT_IN }}' + LLVM_PROFILE_FILE: 'default.profraw' + run: ./cpp_bindings_linux_tests --gtest_color=yes + + - name: 'Merge profile and export lcov' + working-directory: build + run: | + llvm-profdata merge -o default.profdata default.profraw + llvm-cov export -instr-profile=default.profdata \ + ./cpp_bindings_linux_tests \ + -object=./libcpp_bindings_linux.so \ + -format=lcov \ + -ignore-filename-regex='.*/GTest.*' \ + -ignore-filename-regex='.*/googletest.*' \ + -ignore-filename-regex='.*/cpp_core.*' \ + > lcov.info + + - name: 'Code Coverage Annotation' + uses: ggilder/codecoverage@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERAGE_FILE_PATH: './build/lcov.info' + COVERAGE_FORMAT: 'lcov' diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..0e30c7a --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,46 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "default", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "linux-gcc-release", + "displayName": "Linux GCC Release", + "inherits": "default", + "cacheVariables": { + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "coverage", + "displayName": "Clang Code Coverage", + "inherits": "default", + "cacheVariables": { + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_FLAGS": "-fprofile-instr-generate -fcoverage-mapping", + "CMAKE_EXE_LINKER_FLAGS": "-fprofile-instr-generate -fcoverage-mapping", + "CMAKE_SHARED_LINKER_FLAGS": "-fprofile-instr-generate -fcoverage-mapping" + } + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "linux-gcc-release" + }, + { + "name": "coverage", + "configurePreset": "coverage" + } + ] +} From cd6c0307e7a6a9428a90a89c2aac4e0c4d679f78 Mon Sep 17 00:00:00 2001 From: Katze719 Date: Thu, 12 Feb 2026 17:32:45 +0100 Subject: [PATCH 53/62] refactor: replace Clang setup step with direct installation and update coverage commands --- .github/workflows/code_coverage_cpp.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/code_coverage_cpp.yml b/.github/workflows/code_coverage_cpp.yml index 6e6c076..c34d62f 100644 --- a/.github/workflows/code_coverage_cpp.yml +++ b/.github/workflows/code_coverage_cpp.yml @@ -23,11 +23,12 @@ jobs: with: fetch-depth: 0 - - name: 'Setup Clang' - uses: egor-tensin/setup-clang@v2 - with: - version: '21' - platform: 'x64' + - name: 'Install Clang and compiler-rt (profile)' + run: | + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-apt.gpg + echo "deb [signed-by=/usr/share/keyrings/llvm-apt.gpg] https://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list + sudo apt-get update + sudo apt-get install -y clang-21 libclang-rt-21-dev llvm-21 - name: 'Setup CMake' uses: jwlawson/actions-setup-cmake@v2 @@ -35,7 +36,10 @@ jobs: cmake-version: '3.31.x' - name: 'Configure CMake (coverage preset)' - run: cmake --preset coverage + run: | + cmake --preset coverage \ + -DCMAKE_C_COMPILER=clang-21 \ + -DCMAKE_CXX_COMPILER=clang++-21 - name: 'Build' run: cmake --build --preset coverage @@ -61,8 +65,8 @@ jobs: - name: 'Merge profile and export lcov' working-directory: build run: | - llvm-profdata merge -o default.profdata default.profraw - llvm-cov export -instr-profile=default.profdata \ + llvm-profdata-21 merge -o default.profdata default.profraw + llvm-cov-21 export -instr-profile=default.profdata \ ./cpp_bindings_linux_tests \ -object=./libcpp_bindings_linux.so \ -format=lcov \ From 3be40c7c8ca56f5f83cbd6c247a45009e620e81b Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:00:29 +0100 Subject: [PATCH 54/62] fix: refactor --- .github/workflows/build_binary.yml | 10 ---------- .github/workflows/code_coverage_cpp.yml | 20 +++++++++++++------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 89963f0..eec0035 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -91,16 +91,6 @@ jobs: permissions: contents: read checks: write - - code-coverage-cpp: - name: 'Run: CodeCoverage C++' - uses: './.github/workflows/code_coverage_cpp.yml' - with: - artifact-name: cpp_bindings_linux_tests - - permissions: - contents: read - checks: write publish-jsr: name: 'Run: Publish JSR' diff --git a/.github/workflows/code_coverage_cpp.yml b/.github/workflows/code_coverage_cpp.yml index c34d62f..fec03d1 100644 --- a/.github/workflows/code_coverage_cpp.yml +++ b/.github/workflows/code_coverage_cpp.yml @@ -3,11 +3,12 @@ description: | This workflow checks and displays code coverage. on: - workflow_call: - inputs: - artifact-name: - required: true - type: string + push: + branches: [ 'main' ] + tags: [ '*' ] + + pull_request: + branches: [ '*' ] jobs: code-coverage-cpp: @@ -16,6 +17,11 @@ jobs: env: SERIAL_TEST_PORT_IN: /tmp/ttyCI_IN SERIAL_TEST_PORT_OUT: /tmp/ttyCI_OUT + TEST_REPORT_NAME: 'lcov.info' + + permissions: + contents: read + checks: write steps: - name: 'Checkout repository' @@ -73,11 +79,11 @@ jobs: -ignore-filename-regex='.*/GTest.*' \ -ignore-filename-regex='.*/googletest.*' \ -ignore-filename-regex='.*/cpp_core.*' \ - > lcov.info + > $TEST_REPORT_NAME - name: 'Code Coverage Annotation' uses: ggilder/codecoverage@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERAGE_FILE_PATH: './build/lcov.info' + COVERAGE_FILE_PATH: './build/${{ github.env.TEST_REPORT_NAME }}' COVERAGE_FORMAT: 'lcov' From b6b41524c4f5d6260fca85dd2932fdc259726131 Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:47:05 +0100 Subject: [PATCH 55/62] fix: unit tests --- .github/workflows/build_binary.yml | 24 ++-------------- .github/workflows/test_unit_cpp.yml | 44 ++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index eec0035..a597fcc 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -47,22 +47,13 @@ jobs: . build/env.sh echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT - - name: 'Upload artifacts (lib)' + - name: 'Upload artifacts' uses: actions/upload-artifact@v4 with: if-no-files-found: error name: libcpp_bindings_linux path: build/libcpp_bindings_linux.so - - name: 'Upload artifacts (tests)' - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: cpp_bindings_linux_tests - path: | - build/libcpp_bindings_linux.so* - build/cpp_bindings_linux_tests - - name: 'Check tag' id: 'check-tag' env: @@ -80,21 +71,10 @@ jobs: outputs: package_version: ${{ steps.build.outputs.PACKAGE_VERSION }} is_valid_package_version: ${{ steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION }} - - test-unit-cpp: - name: 'Run: Test Unit C++' - needs: ['build-binary'] - uses: './.github/workflows/test_unit_cpp.yml' - with: - artifact-name: cpp_bindings_linux_tests - - permissions: - contents: read - checks: write publish-jsr: name: 'Run: Publish JSR' - needs: ['build-binary', 'test-unit-cpp'] + needs: ['build-binary'] uses: './.github/workflows/publish_jsr.yml' with: publish: ${{ needs.build-binary.outputs.is_valid_package_version == 'true' }} diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 03d8cd0..814433f 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -1,18 +1,17 @@ name: 'Test Unit C++' description: | - This workflow runs the unit tests. + This workflow builds the library and runs the unit tests. on: - workflow_call: - inputs: - artifact-name: - required: true - type: string + workflow_run: + workflows: + - 'Build Binary' jobs: test-unit-cpp: name: 'Test Unit C++' runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} env: SERIAL_TEST_PORT_IN: /tmp/ttyCI_IN SERIAL_TEST_PORT_OUT: /tmp/ttyCI_OUT @@ -25,8 +24,33 @@ jobs: - name: 'Download artifact' uses: actions/download-artifact@v4 with: - name: ${{ inputs.artifact-name }} + run-id: ${{ github.event.workflow_run.id }} + name: libcpp_bindings_linux path: 'artifacts' + + - name: 'Setup GCC' + uses: egor-tensin/setup-gcc@v2 + with: + version: '14' + platform: 'x64' + + - name: 'Setup CMake' + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.31.x' + + - name: 'Configure CMake' + env: + CXX: g++ + + run: | + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + + - name: 'Build' + id: 'build' + run: | + cmake --build build --config Release --target all + #################################### ^ needs to be changed - name: 'Install test dependencies' run: | @@ -40,7 +64,7 @@ jobs: sleep 1 - name: 'Run tests' - working-directory: 'artifacts' + working-directory: 'build' env: LD_LIBRARY_PATH: '${{ github.workspace }}/artifacts' SERIAL_TEST_PORT: '${{ env.SERIAL_TEST_PORT_IN }}' @@ -57,13 +81,13 @@ jobs: uses: actions/upload-artifact@v4 with: name: 'test_reports' - path: 'artifacts/${{ env.TEST_REPORT_NAME }}' + path: 'build/${{ env.TEST_REPORT_NAME }}' - name: 'Publish test report' if: always() uses: mikepenz/action-junit-report@v5 with: - report_paths: 'artifacts/${{ env.TEST_REPORT_NAME }}' + report_paths: 'build/${{ env.TEST_REPORT_NAME }}' detailed_summary: true group_suite: true include_passed: true From 34f814ee746345273c66a0177462fe08f48b9050 Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:54:55 +0100 Subject: [PATCH 56/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 814433f..0af2d8a 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -6,6 +6,9 @@ on: workflow_run: workflows: - 'Build Binary' + + types: + - completed jobs: test-unit-cpp: From 9ff85a22bf7ab203d4cc816693381adf73a59b14 Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:59:19 +0100 Subject: [PATCH 57/62] Update test_unit_cpp.yml --- .github/workflows/test_unit_cpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 0af2d8a..8f7c1c3 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -4,6 +4,9 @@ description: | on: workflow_run: + branches: + - '*' + workflows: - 'Build Binary' From 4353b18f7a9bc340740b985e1174a24f6eef4fb3 Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:09:12 +0100 Subject: [PATCH 58/62] fix: unit tests --- .github/workflows/build_binary.yml | 13 ++++++++++++- .github/workflows/test_unit_cpp.yml | 19 +++++++------------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index a597fcc..9d57636 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -71,10 +71,21 @@ jobs: outputs: package_version: ${{ steps.build.outputs.PACKAGE_VERSION }} is_valid_package_version: ${{ steps.check-tag.outputs.IS_VALID_PACKAGE_VERSION }} + + test-unit-cpp: + name: 'Run: Test Unit C++' + needs: ['build-binary'] + uses: './.github/workflows/test_unit_cpp.yml' + with: + artifact-name: cpp_bindings_linux_tests + + permissions: + contents: read + checks: write publish-jsr: name: 'Run: Publish JSR' - needs: ['build-binary'] + needs: ['build-binary', 'test-unit-cpp'] uses: './.github/workflows/publish_jsr.yml' with: publish: ${{ needs.build-binary.outputs.is_valid_package_version == 'true' }} diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 8f7c1c3..dd78c27 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -3,21 +3,17 @@ description: | This workflow builds the library and runs the unit tests. on: - workflow_run: - branches: - - '*' - - workflows: - - 'Build Binary' - - types: - - completed + workflow_call: + inputs: + artifact-name: + description: 'Name of the artifact' + required: true + type: string jobs: test-unit-cpp: name: 'Test Unit C++' runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} env: SERIAL_TEST_PORT_IN: /tmp/ttyCI_IN SERIAL_TEST_PORT_OUT: /tmp/ttyCI_OUT @@ -30,8 +26,7 @@ jobs: - name: 'Download artifact' uses: actions/download-artifact@v4 with: - run-id: ${{ github.event.workflow_run.id }} - name: libcpp_bindings_linux + name: ${{ github.event.inputs.artifact-name }} path: 'artifacts' - name: 'Setup GCC' From e0f032015712cb086574769be6c42c14a2b0b491 Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:16:08 +0100 Subject: [PATCH 59/62] Update code_coverage_cpp.yml --- .github/workflows/code_coverage_cpp.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code_coverage_cpp.yml b/.github/workflows/code_coverage_cpp.yml index fec03d1..0765262 100644 --- a/.github/workflows/code_coverage_cpp.yml +++ b/.github/workflows/code_coverage_cpp.yml @@ -17,7 +17,6 @@ jobs: env: SERIAL_TEST_PORT_IN: /tmp/ttyCI_IN SERIAL_TEST_PORT_OUT: /tmp/ttyCI_OUT - TEST_REPORT_NAME: 'lcov.info' permissions: contents: read @@ -79,11 +78,11 @@ jobs: -ignore-filename-regex='.*/GTest.*' \ -ignore-filename-regex='.*/googletest.*' \ -ignore-filename-regex='.*/cpp_core.*' \ - > $TEST_REPORT_NAME + > lcov.info - name: 'Code Coverage Annotation' uses: ggilder/codecoverage@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERAGE_FILE_PATH: './build/${{ github.env.TEST_REPORT_NAME }}' + COVERAGE_FILE_PATH: './build/lcov.info' COVERAGE_FORMAT: 'lcov' From f8d9b74a515f985e669a9ce89ddd80da869a6114 Mon Sep 17 00:00:00 2001 From: Katze719 Date: Thu, 12 Feb 2026 20:48:19 +0100 Subject: [PATCH 60/62] refactor: update CMake build commands to use presets for consistency --- .github/workflows/build_binary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 9d57636..e17eadd 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -37,12 +37,12 @@ jobs: CXX: g++ run: | - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake --preset linux-gcc-release - name: 'Build' id: 'build' run: | - cmake --build build --config Release --target all + cmake --build --preset default . build/env.sh echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT From 822623ba577ea09ba6925706c8d313db93bfefcd Mon Sep 17 00:00:00 2001 From: Katze719 Date: Thu, 12 Feb 2026 20:50:14 +0100 Subject: [PATCH 61/62] refactor: modify CMake build commands in workflows to utilize presets for improved clarity --- .github/workflows/build_binary.yml | 2 +- .github/workflows/test_unit_cpp.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index e17eadd..6ec7fb6 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -42,7 +42,7 @@ jobs: - name: 'Build' id: 'build' run: | - cmake --build --preset default + cmake --build --preset default --target cpp_bindings_linux . build/env.sh echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index dd78c27..8d72d1f 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -45,13 +45,12 @@ jobs: CXX: g++ run: | - cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake --preset linux-gcc-release - name: 'Build' id: 'build' run: | - cmake --build build --config Release --target all - #################################### ^ needs to be changed + cmake --build --preset default --target cpp_bindings_linux_tests - name: 'Install test dependencies' run: | From 252fe809e30a734a896d9052fbabdd49c946925a Mon Sep 17 00:00:00 2001 From: Mqx <62719703+Mqxx@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:55:19 +0100 Subject: [PATCH 62/62] fix: presets --- .github/workflows/build_binary.yml | 2 +- .github/workflows/test_unit_cpp.yml | 5 +---- CMakePresets.json | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 6ec7fb6..33d2339 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -42,7 +42,7 @@ jobs: - name: 'Build' id: 'build' run: | - cmake --build --preset default --target cpp_bindings_linux + cmake --build --preset linux-gcc-release --target cpp_bindings_linux . build/env.sh echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_OUTPUT diff --git a/.github/workflows/test_unit_cpp.yml b/.github/workflows/test_unit_cpp.yml index 8d72d1f..18d187c 100644 --- a/.github/workflows/test_unit_cpp.yml +++ b/.github/workflows/test_unit_cpp.yml @@ -41,16 +41,13 @@ jobs: cmake-version: '3.31.x' - name: 'Configure CMake' - env: - CXX: g++ - run: | cmake --preset linux-gcc-release - name: 'Build' id: 'build' run: | - cmake --build --preset default --target cpp_bindings_linux_tests + cmake --build --preset linux-gcc-release --target cpp_bindings_linux_tests - name: 'Install test dependencies' run: | diff --git a/CMakePresets.json b/CMakePresets.json index 0e30c7a..4d82a39 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -35,7 +35,7 @@ ], "buildPresets": [ { - "name": "default", + "name": "linux-gcc-release", "configurePreset": "linux-gcc-release" }, {