From 2999a642c54bb275cd48f54e998f68bcba5adf1a Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 21:16:11 +0300 Subject: [PATCH 01/11] Create c-cpp-cmake.yml Added CI integration for cmake --- .github/workflows/c-cpp-cmake.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/c-cpp-cmake.yml diff --git a/.github/workflows/c-cpp-cmake.yml b/.github/workflows/c-cpp-cmake.yml new file mode 100644 index 0000000..6a9c312 --- /dev/null +++ b/.github/workflows/c-cpp-cmake.yml @@ -0,0 +1,23 @@ +name: C/C++ CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: configure + run: ./configure + - name: make + run: make + - name: make check + run: make check + - name: make distcheck + run: make distcheck From 424ef0b0585b946b581ccae4f5c84d954918bd98 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 21:17:54 +0300 Subject: [PATCH 02/11] Update c-cpp-cmake.yml Replaced to build.sh --- .github/workflows/c-cpp-cmake.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/c-cpp-cmake.yml b/.github/workflows/c-cpp-cmake.yml index 6a9c312..fe29fa3 100644 --- a/.github/workflows/c-cpp-cmake.yml +++ b/.github/workflows/c-cpp-cmake.yml @@ -13,11 +13,5 @@ jobs: steps: - uses: actions/checkout@v4 - - name: configure - run: ./configure - - name: make - run: make - - name: make check - run: make check - - name: make distcheck - run: make distcheck + - name: build.sh + run: ./build.sh From b90f88a7d61c904ca78f0f8b724e0bbf4ba913c1 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 21:41:11 +0300 Subject: [PATCH 03/11] Fixed issues with SocketImpl WiFiClientSecure.h. While compile error reason seems obvious, but code does not verifyed on field. --- ArduinoCore-Linux/cores/arduino/WiFiClientSecure.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArduinoCore-Linux/cores/arduino/WiFiClientSecure.h b/ArduinoCore-Linux/cores/arduino/WiFiClientSecure.h index 09671b6..ac8760f 100644 --- a/ArduinoCore-Linux/cores/arduino/WiFiClientSecure.h +++ b/ArduinoCore-Linux/cores/arduino/WiFiClientSecure.h @@ -1,6 +1,7 @@ #pragma once #if defined(USE_HTTPS) #include +#include "Ethernet.h" namespace arduino { @@ -56,7 +57,7 @@ class SocketImplSecure : public SocketImpl { class WiFiClientSecure : public EthernetClient { public: WiFiClientSecure(int bufferSize = 256, long timeout = 2000) - : EthernetClient(bufferSize, timeout, new SocketImplSecure()) {} + : EthernetClient(SocketImplSecure { }, bufferSize, timeout) {} }; } // namespace arduino From 03a18f6ebdbf512c72a3a2fc7a1fdef97765861f Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 22:11:17 +0300 Subject: [PATCH 04/11] Create unit-tests.yml to run unit tests --- .github/workflows/unit-tests.yml | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..ce65be4 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,47 @@ +name: Unit Tests + +on: + pull_request: + # Only run workflow if a file in these paths is modified + paths: + - ".github/workflows/unit-tests.yml" + - "ArduinoCore-API/test/**" + - "ArduinoCore-API/api/**" + + push: + paths: + - ".github/workflows/unit-tests.yml" + - "ArduinoCore-API/test/**" + - "ArduinoCore-API/api/**" + +jobs: + test: + name: Run unit tests + runs-on: ubuntu-latest + + env: + COVERAGE_DATA_PATH: extras/coverage-data/coverage.info + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # See: https://github.com/arduino/cpp-test-action/blob/main/README.md + - uses: arduino/cpp-test-action@main + with: + source-path: ArduinoCore-API/test + build-path: ArduinoCore-API/test/build + runtime-path: ArduinoCore-API/test/build/bin/test-ArduinoCore-API + coverage-exclude-paths: | + - '*/test/*' + - '/usr/*' + coverage-data-path: ${{ env.COVERAGE_DATA_PATH }} + + # Temporary excluded to prevent token requirement + # See: https://github.com/codecov/codecov-action/blob/master/README.md + #- name: Code coverage + # uses: codecov/codecov-action@v3 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} + # files: ${{ env.COVERAGE_DATA_PATH }} + # fail_ci_if_error: true From 83767a33d9874a35c279c877715cf3997b281c3e Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 23:06:32 +0300 Subject: [PATCH 05/11] Update unit-tests.yml - added links to String --- .github/workflows/unit-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ce65be4..a761e0d 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -26,6 +26,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Create link to String.h + run: echo '#include "WString.h"' > ArduinoCore-API/api/String.h + + - name: Create link to String.cpp + run: echo '#include "WString.cpp"' > ArduinoCore-API/api/String.cpp + # See: https://github.com/arduino/cpp-test-action/blob/main/README.md - uses: arduino/cpp-test-action@main with: From dd69e1d8abeb5e90b1aca2d46a04cebad0812f87 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 23:16:13 +0300 Subject: [PATCH 06/11] Update unit-tests.yml added workaround to catch lib --- .github/workflows/unit-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index a761e0d..f39bc5d 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -32,6 +32,9 @@ jobs: - name: Create link to String.cpp run: echo '#include "WString.cpp"' > ArduinoCore-API/api/String.cpp + - name: Fix catch lib issues + run: echo 'add_compile_definitions(CATCH_CONFIG_NO_POSIX_SIGNALS)' >> ArduinoCore-API/test/CMakeLists.txt + # See: https://github.com/arduino/cpp-test-action/blob/main/README.md - uses: arduino/cpp-test-action@main with: From cc09e460b8423478df37291bdc8a0fee26a255b7 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 23:21:43 +0300 Subject: [PATCH 07/11] Update unit-tests.yml relaxed compile warns --- .github/workflows/unit-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f39bc5d..d4f0bcd 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -35,6 +35,9 @@ jobs: - name: Fix catch lib issues run: echo 'add_compile_definitions(CATCH_CONFIG_NO_POSIX_SIGNALS)' >> ArduinoCore-API/test/CMakeLists.txt + - name: Relax some warings + run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt + # See: https://github.com/arduino/cpp-test-action/blob/main/README.md - uses: arduino/cpp-test-action@main with: From 821ca5cb4a0bdc2203aaec3cd7dd27056c64fb11 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Mon, 29 Sep 2025 23:36:48 +0300 Subject: [PATCH 08/11] Update unit-tests.yml yet more relax on warns --- .github/workflows/unit-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d4f0bcd..1104ebc 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -36,7 +36,9 @@ jobs: run: echo 'add_compile_definitions(CATCH_CONFIG_NO_POSIX_SIGNALS)' >> ArduinoCore-API/test/CMakeLists.txt - name: Relax some warings - run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt + # run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt + run: echo 'add_compile_options(-Wno-error)' >> ArduinoCore-API/test/CMakeLists.txt + # See: https://github.com/arduino/cpp-test-action/blob/main/README.md - uses: arduino/cpp-test-action@main From f168a7994ffa4fff79390911fd76fcc274c3f041 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Tue, 30 Sep 2025 00:50:19 +0300 Subject: [PATCH 09/11] Update unit-tests.yml add =all to Wno-error --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1104ebc..f0b6b49 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -37,7 +37,7 @@ jobs: - name: Relax some warings # run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt - run: echo 'add_compile_options(-Wno-error)' >> ArduinoCore-API/test/CMakeLists.txt + run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt # See: https://github.com/arduino/cpp-test-action/blob/main/README.md From 84332168150b6a175fc6aa0c773b36334ae1c01a Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Tue, 30 Sep 2025 00:59:30 +0300 Subject: [PATCH 10/11] Update unit-tests.yml no error for unused func --- .github/workflows/unit-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f0b6b49..ae374b7 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -37,7 +37,8 @@ jobs: - name: Relax some warings # run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt - run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt + # run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt + run: echo 'add_compile_options(-Wno-error=unused-function)' >> ArduinoCore-API/test/CMakeLists.txt # See: https://github.com/arduino/cpp-test-action/blob/main/README.md From 478d040ab081db295e960d0f772ff8ea59ea51c2 Mon Sep 17 00:00:00 2001 From: Serge Ageyev Date: Tue, 30 Sep 2025 01:27:41 +0300 Subject: [PATCH 11/11] Update unit-tests.yml remove werror --- .github/workflows/unit-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ae374b7..4f12a36 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -38,7 +38,8 @@ jobs: - name: Relax some warings # run: echo 'add_compile_options(-Wno-unused-function)' >> ArduinoCore-API/test/CMakeLists.txt # run: echo 'add_compile_options(-Wno-error=all)' >> ArduinoCore-API/test/CMakeLists.txt - run: echo 'add_compile_options(-Wno-error=unused-function)' >> ArduinoCore-API/test/CMakeLists.txt + # run: echo 'add_compile_options(-Wno-error=unused-function)' >> ArduinoCore-API/test/CMakeLists.txt + run: sed -i 's/-Werror//g' ArduinoCore-API/test/CMakeLists.txt # See: https://github.com/arduino/cpp-test-action/blob/main/README.md