From 71d1caf3a503127b7f9e45053661e84611c45ccb Mon Sep 17 00:00:00 2001
From: jr0me <joaquin.romera@wazuh.com>
Date: Mon, 14 Oct 2024 19:03:25 -0300
Subject: [PATCH 1/4] feat: remove LLVM 16 installation from coverage workflow

With the latest github runner for linux (ubuntu 24), clang
16 is now part of the runners default stack.

We still add llvm to use llvm-cov as part of the coverage
target.
---
 .github/workflows/coverage_check.yml | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/coverage_check.yml b/.github/workflows/coverage_check.yml
index c3d6c666bf..d2a0863b8f 100644
--- a/.github/workflows/coverage_check.yml
+++ b/.github/workflows/coverage_check.yml
@@ -18,27 +18,15 @@ jobs:
         submodules: true
         fetch-depth: 0
 
-    - name: Install Clang 16 and LLVM 16
-      run: |
-        sudo apt-get update
-        wget https://apt.llvm.org/llvm.sh
-        chmod +x llvm.sh
-        sudo ./llvm.sh 16
-
     - name: Set up dependencies
       run: |
         sudo apt-get update
-        sudo apt-get install -y cmake gcovr libsystemd-dev
-        sudo apt-get install -y autopoint libtool zlib1g-dev \
-          libgcrypt20-dev libmagic-dev libpopt-dev libmagic-dev \
-          libsqlite3-dev liblua5.4-dev gettext libarchive-dev
-      shell: bash
-
-    - name: Update PATH for LLVM
-      run: echo "/usr/lib/llvm-16/bin" >> $GITHUB_PATH
+        sudo apt-get install -y cmake llvm gcovr libsystemd-dev autopoint \
+          libtool zlib1g-dev libgcrypt20-dev libmagic-dev libpopt-dev \
+          libmagic-dev libsqlite3-dev liblua5.4-dev gettext libarchive-dev
       shell: bash
 
-    - name: Set up Binary caching 
+    - name: Set up Binary caching
       uses: ./.github/actions/vcpkg_related/cover_vcpkg_dependencies
       with:
         gh_token: ${{ secrets.GITHUB_TOKEN }}

From 6c9bf0cbd153e8afd7e0988e87ee3fa92e0dd1d8 Mon Sep 17 00:00:00 2001
From: jr0me <joaquin.romera@wazuh.com>
Date: Mon, 14 Oct 2024 19:24:02 -0300
Subject: [PATCH 2/4] feat: disable clang tidy in coverage check

There's no need to check clang tidy rules for the coverage
workflow. It is already covered by other actions.
---
 .github/workflows/coverage_check.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/coverage_check.yml b/.github/workflows/coverage_check.yml
index d2a0863b8f..2a427d57f9 100644
--- a/.github/workflows/coverage_check.yml
+++ b/.github/workflows/coverage_check.yml
@@ -34,7 +34,7 @@ jobs:
     - name: Generate CMake project
       run: |
         mkdir -p build && cd build
-        cmake -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 ../src -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=1 -DCOVERAGE=1 -G "Unix Makefiles"
+        cmake -DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16 ../src -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=1 -DCOVERAGE=1 -DENABLE_CLANG_TIDY=OFF -G "Unix Makefiles"
       shell: bash
 
     - name: Compile

From 42f529890ccb31bc76148c1294e39e77461eee1d Mon Sep 17 00:00:00 2001
From: jr0me <joaquin.romera@wazuh.com>
Date: Mon, 14 Oct 2024 21:49:20 -0300
Subject: [PATCH 3/4] feat: use more procs in coverage check

---
 .github/workflows/coverage_check.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/coverage_check.yml b/.github/workflows/coverage_check.yml
index 2a427d57f9..b95954bc6f 100644
--- a/.github/workflows/coverage_check.yml
+++ b/.github/workflows/coverage_check.yml
@@ -40,13 +40,13 @@ jobs:
     - name: Compile
       run: |
         cd build
-        cmake --build . --config Debug
+        cmake --build . --config Debug -j $(nproc)
       shell: bash
 
     - name: Generate and Check Coverage
       run: |
         cd build
-        cmake --build . --target coverage
+        cmake --build . --target coverage -j $(nproc)
       shell: bash
 
     - name: Zip Coverage Files

From 392b8f6e4a4814964a32e4eef60087b0569b9fb6 Mon Sep 17 00:00:00 2001
From: jr0me <joaquin.romera@wazuh.com>
Date: Mon, 14 Oct 2024 22:46:25 -0300
Subject: [PATCH 4/4] feat: add missing key to enable binary caching

---
 .github/workflows/coverage_check.yml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.github/workflows/coverage_check.yml b/.github/workflows/coverage_check.yml
index b95954bc6f..903436b176 100644
--- a/.github/workflows/coverage_check.yml
+++ b/.github/workflows/coverage_check.yml
@@ -7,6 +7,9 @@ on:
       - synchronize
       - reopened
 
+env:
+  VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
+
 jobs:
   coverage:
     runs-on: ubuntu-latest