From 546355a190b2a1b008bb87dac627ab31bd77ac1c Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Wed, 30 Jul 2025 16:53:27 +0200 Subject: [PATCH 01/15] Add linter analysis workflow --- .github/workflows/analysis.yml | 66 ++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/analysis.yml diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 00000000..784813a0 --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,66 @@ +name: cpp-linter-analysis + +on: [push, pull_request] + +defaults: + run: + shell: bash -e -l {0} + +jobs: + build: + runs-on: ubuntu-24.04 + + steps: + # Set up Clang and LLVM + - name: Install LLVM and Clang + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 20 + sudo apt-get install -y clang-tools-20 + sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 200 + sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 200 + sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-20 200 + sudo update-alternatives --set clang /usr/bin/clang-20 + sudo update-alternatives --set clang++ /usr/bin/clang++-20 + sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-20 + + - name: Checkout repository + uses: actions/checkout@v4 + + # Set conda environment using setup-micromamba + - name: Set conda environment + uses: mamba-org/setup-micromamba@main + with: + environment-name: myenv + environment-file: environment-dev.yml + init-shell: bash + cache-downloads: true + + # Run CMake configuration + - name: Configure using CMake + run: | + export CC=clang; export CXX=clang++ + cmake -G Ninja \ + -Bbuild \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ + -DBUILD_TESTS=ON \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + #-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING + + # Run Clang-Tidy and Clang-Format Analysis + - name: Run C++ analysis + uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + version: 20 + files-changed-only: false # check all files + database: 'build' + style: 'file' # Use .clang-format config file + tidy-checks: '' # Use .clang-tidy config file + step-summary: true + ignore: 'build' + extra-args: '-std=c++20' From de3414a55213693e7eefbcf5ef3a431fb38f0eed Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Wed, 30 Jul 2025 17:33:18 +0200 Subject: [PATCH 02/15] Enable failure --- .github/workflows/analysis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 784813a0..8ccbc371 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -61,6 +61,9 @@ jobs: database: 'build' style: 'file' # Use .clang-format config file tidy-checks: '' # Use .clang-tidy config file - step-summary: true + step-summary: false # Disable summary output for more detailed logs ignore: 'build' extra-args: '-std=c++20' + - name: Fail fast?! + if: steps.linter.outputs.checks-failed > 0 + run: exit 1 From 0adc8d000e8f1d56462d42942225c7846b16ce1a Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 31 Jul 2025 10:46:20 +0200 Subject: [PATCH 03/15] Add thread-comments and set step-summary --- .github/workflows/analysis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 8ccbc371..13335cb8 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -61,9 +61,10 @@ jobs: database: 'build' style: 'file' # Use .clang-format config file tidy-checks: '' # Use .clang-tidy config file - step-summary: false # Disable summary output for more detailed logs + step-summary: true ignore: 'build' extra-args: '-std=c++20' - - name: Fail fast?! + thread-comments: true + - name: Fail fast if: steps.linter.outputs.checks-failed > 0 run: exit 1 From df95e8285fb2f461d1c8cf544d4aa45ae6bb87b8 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 15:41:32 +0100 Subject: [PATCH 04/15] Remove thread-comments --- .github/workflows/analysis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 13335cb8..7e78ff97 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -64,7 +64,6 @@ jobs: step-summary: true ignore: 'build' extra-args: '-std=c++20' - thread-comments: true - name: Fail fast if: steps.linter.outputs.checks-failed > 0 run: exit 1 From c1b56061ffe2dafe8fcc268020bc85de537209ce Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 16:02:29 +0100 Subject: [PATCH 05/15] Add missing header --- include/sparrow_ipc/compression.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sparrow_ipc/compression.hpp b/include/sparrow_ipc/compression.hpp index c1d080e9..5dc6d6c1 100644 --- a/include/sparrow_ipc/compression.hpp +++ b/include/sparrow_ipc/compression.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include From 3b86646a5f651a09363e35be842edd2ea385e706 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 16:05:24 +0100 Subject: [PATCH 06/15] Add build step --- .github/workflows/analysis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 7e78ff97..5d02a0a1 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -47,7 +47,11 @@ jobs: -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -DBUILD_TESTS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - #-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING + + # Build sparrow-ipc to have the generated flatbuffers files available + - name: Build sparrow-ipc + working-directory: build + run: cmake --build . --target sparrow-ipc # Run Clang-Tidy and Clang-Format Analysis - name: Run C++ analysis From fbd17dc2bbd7ce6e8f981f3857e095bae06807bf Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 16:18:07 +0100 Subject: [PATCH 07/15] Set SPARROW_IPC_BUILD_TESTS and SPARROW_IPC_BUILD_EXAMPLES to make all headers available --- .github/workflows/analysis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 5d02a0a1..080f0c45 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -45,7 +45,8 @@ jobs: -Bbuild \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -DBUILD_TESTS=ON \ + -DSPARROW_IPC_BUILD_TESTS=ON \ + -DSPARROW_IPC_BUILD_EXAMPLES=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON # Build sparrow-ipc to have the generated flatbuffers files available From 13b9e54275c923b665bdb2939d8a4ed4e428d481 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 16:44:42 +0100 Subject: [PATCH 08/15] Ignore tests folder --- .github/workflows/analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 080f0c45..4731c71a 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -69,6 +69,7 @@ jobs: step-summary: true ignore: 'build' extra-args: '-std=c++20' + ignore: tests - name: Fail fast if: steps.linter.outputs.checks-failed > 0 run: exit 1 From 8ac43431963c4b3e493dfb745334624fb8e164ca Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 16:49:43 +0100 Subject: [PATCH 09/15] Remove redundant ignore --- .github/workflows/analysis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 4731c71a..7ba9111a 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -67,9 +67,8 @@ jobs: style: 'file' # Use .clang-format config file tidy-checks: '' # Use .clang-tidy config file step-summary: true - ignore: 'build' + ignore: build|tests extra-args: '-std=c++20' - ignore: tests - name: Fail fast if: steps.linter.outputs.checks-failed > 0 run: exit 1 From 5566866a408c584830004dd57891bff8301e895c Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Thu, 4 Dec 2025 16:58:24 +0100 Subject: [PATCH 10/15] Remove fail fast (because, so many warnings...) --- .github/workflows/analysis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 7ba9111a..ed7fb052 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -67,8 +67,5 @@ jobs: style: 'file' # Use .clang-format config file tidy-checks: '' # Use .clang-tidy config file step-summary: true - ignore: build|tests + ignore: build extra-args: '-std=c++20' - - name: Fail fast - if: steps.linter.outputs.checks-failed > 0 - run: exit 1 From ff5c264427d309ed95036b319d392d2561f125b3 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Fri, 5 Dec 2025 10:08:37 +0100 Subject: [PATCH 11/15] Fix some warnings --- include/sparrow_ipc/compression.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sparrow_ipc/compression.hpp b/include/sparrow_ipc/compression.hpp index 5dc6d6c1..c703bd35 100644 --- a/include/sparrow_ipc/compression.hpp +++ b/include/sparrow_ipc/compression.hpp @@ -11,7 +11,7 @@ namespace sparrow_ipc { - enum class CompressionType + enum class CompressionType : std::uint8_t { LZ4_FRAME, ZSTD @@ -34,9 +34,9 @@ namespace sparrow_ipc std::optional> find(const void* data_ptr, const size_t data_size); std::span store(const void* data_ptr, const size_t data_size, std::vector&& data); - size_t size() const; - size_t count(const void* data_ptr, const size_t data_size) const; - bool empty() const; + [[nodiscard]] size_t size() const; + [[nodiscard]] size_t count(const void* data_ptr, const size_t data_size) const; + [[nodiscard]] bool empty() const; void clear(); private: From f962357853acef4095438af9bdae671851245553 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Tue, 9 Dec 2025 11:07:01 +0100 Subject: [PATCH 12/15] Add integration tests build to make headers available --- .github/workflows/analysis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index ed7fb052..b6f0e697 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -46,6 +46,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ -DSPARROW_IPC_BUILD_TESTS=ON \ + -DSPARROW_IPC_BUILD_INTEGRATION_TESTS=ON \ -DSPARROW_IPC_BUILD_EXAMPLES=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON From 9f6de6249e3aa9bfd1662bc204fa6d7056c52e12 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Tue, 9 Dec 2025 11:56:21 +0100 Subject: [PATCH 13/15] Include build/generated path as extra arg --- .github/workflows/analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index b6f0e697..00ffb63b 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -69,4 +69,4 @@ jobs: tidy-checks: '' # Use .clang-tidy config file step-summary: true ignore: build - extra-args: '-std=c++20' + extra-args: '-std=c++20 -Ibuild/generated' From 1c91a25a00a969f53fc57d62dcbd68e195a21cb0 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Tue, 9 Dec 2025 15:09:32 +0100 Subject: [PATCH 14/15] Try something --- .github/workflows/analysis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 00ffb63b..c8dd1a38 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -55,6 +55,9 @@ jobs: working-directory: build run: cmake --build . --target sparrow-ipc + - name: Verify generated files + run: ls -lR build/generated + # Run Clang-Tidy and Clang-Format Analysis - name: Run C++ analysis uses: cpp-linter/cpp-linter-action@v2 @@ -69,4 +72,4 @@ jobs: tidy-checks: '' # Use .clang-tidy config file step-summary: true ignore: build - extra-args: '-std=c++20 -Ibuild/generated' + extra-args: '-std=c++20 -I${{ github.workspace }}/build/generated' From 911f3793cfe404b09bac0e423855aef41cc219d5 Mon Sep 17 00:00:00 2001 From: Hind Montassif Date: Tue, 9 Dec 2025 15:31:32 +0100 Subject: [PATCH 15/15] Remove debug logs --- .github/workflows/analysis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index c8dd1a38..8c19a208 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -55,9 +55,6 @@ jobs: working-directory: build run: cmake --build . --target sparrow-ipc - - name: Verify generated files - run: ls -lR build/generated - # Run Clang-Tidy and Clang-Format Analysis - name: Run C++ analysis uses: cpp-linter/cpp-linter-action@v2