From f71aeed2b1dc4c6fb6ef663a6f539e03088ba229 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 14:55:20 +1100 Subject: [PATCH 01/19] Do coverage in clang so it can be done in release mode --- .github/workflows/sonarcloud.yaml | 4 +++- src/CMakeLists.txt | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index f147354d..e0da61d3 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -53,7 +53,9 @@ jobs: -GNinja \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTS=ON \ -DCI_BUILD=ON \ -DENABLE_COVERAGE=ON \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 65f18091..4f3fddc5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -42,8 +42,15 @@ if(ENABLE_COVERAGE) if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") message(WARNING "Coverage is enabled but not build in debug mode. Coverage results may be misleading.") endif() - target_compile_options(nuclear PUBLIC -fprofile-arcs -ftest-coverage -fprofile-abs-path -fprofile-update=atomic) - target_link_options(nuclear PUBLIC -fprofile-arcs) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(nuclear PUBLIC -fprofile-arcs -ftest-coverage -fprofile-abs-path -fprofile-update=atomic) + target_link_options(nuclear PUBLIC -fprofile-arcs) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(nuclear PUBLIC -fprofile-instr-generate -fcoverage-mapping) + target_link_options(nuclear PUBLIC -fprofile-instr-generate) + else() + message(FATAL_ERROR "Coverage is not supported for the current compiler.") + endif() endif(ENABLE_COVERAGE) # Enable warnings, and all warnings are errors From 0855a7d7b3071f19d95a0eeaf2524b524ed9175c Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 15:04:44 +1100 Subject: [PATCH 02/19] Only for gcc is it misleading, clang is fine with release mode --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f3fddc5..7ed0fb8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,10 +39,10 @@ target_compile_features(nuclear PUBLIC cxx_std_14) option(ENABLE_COVERAGE "Compile with coverage support enabled.") if(ENABLE_COVERAGE) - if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - message(WARNING "Coverage is enabled but not build in debug mode. Coverage results may be misleading.") - endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + message(WARNING "Coverage is enabled but not build in debug mode. Coverage results may be misleading.") + endif() target_compile_options(nuclear PUBLIC -fprofile-arcs -ftest-coverage -fprofile-abs-path -fprofile-update=atomic) target_link_options(nuclear PUBLIC -fprofile-arcs) elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") From 2cfc8631416f0b2f21d960abcfe5801ab068ca8e Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 17:56:34 +1100 Subject: [PATCH 03/19] Try to do test coverage using clang and see what happens --- .github/workflows/sonarcloud.yaml | 29 ++++------------ cmake/TestRunner.cmake | 57 +++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index e0da61d3..dff021af 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -26,9 +26,6 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Install gcovr - run: pip install gcovr==8.2 - - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 @@ -61,14 +58,14 @@ jobs: -DENABLE_COVERAGE=ON \ -DENABLE_CLANG_TIDY=OFF - - name: Build the code in debug mode + - name: Build the code timeout-minutes: 30 - run: cmake --build build/ --config Debug + run: cmake --build build/ --config Release - name: Run tests to generate coverage statistics timeout-minutes: 10 working-directory: build - run: ninja run_all_tests -j1 -k 0 + run: ninja coverage -k 0 - name: Test Summary if: ${{ !cancelled() }} @@ -76,26 +73,12 @@ jobs: with: paths: "build/reports/tests/*.junit.xml" - - name: Collect coverage into one XML report - if: ${{ !cancelled() }} - run: | - gcovr \ - --root . \ - --object-directory build \ - --force-color \ - --no-markers \ - --decisions \ - --calls \ - --exclude-noncode-lines \ - --gcov-ignore-parse-errors negative_hits.warn \ - --sonarqube "coverage.xml" - - name: Upload coverage report if: ${{ !cancelled() }} uses: actions/upload-artifact@v4 with: - name: coverage-sonar - path: coverage.xml + name: coverage + path: build/reports/coverage.txt retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day) overwrite: true @@ -111,7 +94,7 @@ jobs: --define sonar.sources=src \ --define sonar.tests=tests \ --define sonar.cfamily.compile-commands=build/compile_commands.json \ - --define sonar.coverageReportPaths=coverage.xml + --define sonar.cfamily.llvm-cov.reportPath=build/reports/coverage.txt - name: Upload Traces if: ${{ !cancelled() }} diff --git a/cmake/TestRunner.cmake b/cmake/TestRunner.cmake index 0d307082..3a19cfaf 100644 --- a/cmake/TestRunner.cmake +++ b/cmake/TestRunner.cmake @@ -36,25 +36,68 @@ get_all_catch_test_targets(all_targets ${PROJECT_SOURCE_DIR}) # Create a custom command for each test target to run it # Make sure that coverage data is written with paths relative to the source directory -unset(reports) +unset(report_outputs) +unset(coverage_reports) foreach(target ${all_targets}) - set(sonarqube_report_file "${PROJECT_BINARY_DIR}/reports/tests/${target}.sonarqube.xml") + unset(command_prefix) + if(ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # Extra output files for the profile data + set(raw_coverage "${PROJECT_BINARY_DIR}/reports/tests/${target}.profraw") + set(indexed_coverage "${PROJECT_BINARY_DIR}/reports/tests/${target}.profdata") + set(coverage_report "${PROJECT_BINARY_DIR}/reports/tests/${target}.txt") + set(command_prefix "cmake" "-E" "env" "LLVM_PROFILE_FILE=${raw_coverage}") + list(APPEND coverage_reports ${coverage_report}) + endif() + set(junit_report_file "${PROJECT_BINARY_DIR}/reports/tests/${target}.junit.xml") - list(APPEND reports ${sonarqube_report_file} ${junit_report_file}) + list(APPEND report_outputs ${junit_report_file}) add_custom_command( - OUTPUT ${sonarqube_report_file} ${junit_report_file} - COMMAND $ --reporter console --reporter SonarQube::out=${sonarqube_report_file} --reporter - JUnit::out=${junit_report_file} + OUTPUT ${junit_report_file} ${raw_coverage} + COMMAND ${command_prefix} $ --reporter console --reporter JUnit::out=${junit_report_file} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${target} USES_TERMINAL COMMENT "Running test ${target}" ) + + if(ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_custom_command( + OUTPUT ${indexed_coverage} + COMMAND llvm-profdata merge -sparse ${raw_coverage} -o ${indexed_coverage} + DEPENDS ${raw_coverage} + ) + + add_custom_command( + OUTPUT ${coverage_report} + COMMAND llvm-cov show --show-branches=count -Xdemangler c++filt + -instr-profile=${CMAKE_CURRENT_BINARY_DIR}/coverage.profdata $ > ${coverage_report} + DEPENDS ${indexed_coverage} + ) + endif() + endforeach() # Create a custom target that depends on all test targets add_custom_target( run_all_tests - DEPENDS ${reports} + DEPENDS ${report_outputs} ${all_targets} COMMENT "Running all Catch2 tests" ) + +# Concatenate all the coverage reports together +if(ENABLE_COVERAGE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/reports/coverage.txt + COMMAND cat ${coverage_reports} > ${PROJECT_BINARY_DIR}/reports/coverage.txt + DEPENDS ${coverage_reports} + ) + + add_custom_target( + coverage + DEPENDS ${PROJECT_BINARY_DIR}/reports/coverage.txt + COMMENT "Running all Catch2 tests with coverage" + ) + +endif() From 131ac085e9ed12008940ec5e3ebca127aef0d75b Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 17:58:43 +1100 Subject: [PATCH 04/19] /shrug --- .github/workflows/sonarcloud.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index dff021af..7f684de2 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -29,6 +29,11 @@ jobs: - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v2 + with: + version: "20.0" + - name: Install CMake uses: lukka/get-cmake@v3.30.5 with: From 798874d0de05d22daab1b0500a2a2faccee7ff6b Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 17:59:35 +1100 Subject: [PATCH 05/19] maybe just 18 --- .github/workflows/sonarcloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 7f684de2..774547df 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -32,7 +32,7 @@ jobs: - name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v2 with: - version: "20.0" + version: 18 - name: Install CMake uses: lukka/get-cmake@v3.30.5 From 4b8748d86b125a41ebd34cf23d0a804b57b48ee8 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 18:02:45 +1100 Subject: [PATCH 06/19] . --- .github/workflows/sonarcloud.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 774547df..dff021af 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -29,11 +29,6 @@ jobs: - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 - - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v2 - with: - version: 18 - - name: Install CMake uses: lukka/get-cmake@v3.30.5 with: From 4a6a73b4e38540f857e0511b407a805021e3dba7 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 18:03:41 +1100 Subject: [PATCH 07/19] . --- .github/workflows/sonarcloud.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index dff021af..fdfed226 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -26,6 +26,9 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install dependencies + run: sudo apt-get install -y llvm-profdata llvm-cov + - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 From 3b22ff31b731155b9c8c2dd0efb881d633e7b634 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 18:05:02 +1100 Subject: [PATCH 08/19] . --- .github/workflows/sonarcloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index fdfed226..e5061b1d 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Install dependencies - run: sudo apt-get install -y llvm-profdata llvm-cov + run: sudo apt-get-update && sudo apt-get install -y llvm-profdata llvm-cov - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 From 245536e5ce85334d20aec138c4a15c7718b26544 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 18:05:42 +1100 Subject: [PATCH 09/19] . --- .github/workflows/sonarcloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index e5061b1d..0dec5617 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Install dependencies - run: sudo apt-get-update && sudo apt-get install -y llvm-profdata llvm-cov + run: sudo apt-get update && sudo apt-get install -y llvm-profdata llvm-cov - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 From af58f31039b01ba7dc41e0042a61c6ad1b09e1ab Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 19:08:49 +1100 Subject: [PATCH 10/19] /shrug --- .github/workflows/sonarcloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 0dec5617..84108598 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y llvm-profdata llvm-cov + run: sudo apt-get update && sudo apt-get install -y llvm-18 - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 From 722136fac3012cc045714f3de6971d32c5aad879 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 19:45:44 +1100 Subject: [PATCH 11/19] . --- .github/workflows/sonarcloud.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 84108598..56196ea5 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -26,12 +26,14 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y llvm-18 - - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v2 + with: + version: "18" + - name: Install CMake uses: lukka/get-cmake@v3.30.5 with: From 759d96c69c68d88f9cd9df3a0f7388127074e432 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 19:59:18 +1100 Subject: [PATCH 12/19] can I container? --- .github/workflows/sonarcloud.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 56196ea5..809e2cf3 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -19,6 +19,7 @@ jobs: sonarcloud: name: SonarCloud runs-on: ubuntu-24.04 + container: silkeh/clang:18 env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: @@ -29,11 +30,6 @@ jobs: - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v3 - - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v2 - with: - version: "18" - - name: Install CMake uses: lukka/get-cmake@v3.30.5 with: From 47db1b2ba0842f9026092b286c814bf281e0c46b Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 20:25:47 +1100 Subject: [PATCH 13/19] ? --- .github/workflows/sonarcloud.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 809e2cf3..f44691cc 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -27,8 +27,14 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Install sonar-scanner and build-wrapper - uses: SonarSource/sonarcloud-github-c-cpp@v3 + - name: Install Prerequisites + run: | + apt-get update + apt-get install -y --no-install-recommends \ + curl + + - name: Install Build Wrapper + uses: SonarSource/sonarqube-scan-action/install-build-wrapper@4 - name: Install CMake uses: lukka/get-cmake@v3.30.5 From 44c7acfe716fa3f45fd72bd2638006c360f93f14 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 20:28:06 +1100 Subject: [PATCH 14/19] . --- .github/workflows/sonarcloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index f44691cc..1a3e46d0 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -34,7 +34,7 @@ jobs: curl - name: Install Build Wrapper - uses: SonarSource/sonarqube-scan-action/install-build-wrapper@4 + uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4 - name: Install CMake uses: lukka/get-cmake@v3.30.5 From e32d886bef108b733423ed258601f66f063873fc Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 20:29:14 +1100 Subject: [PATCH 15/19] . --- .github/workflows/sonarcloud.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 1a3e46d0..0ebcceae 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -31,7 +31,8 @@ jobs: run: | apt-get update apt-get install -y --no-install-recommends \ - curl + curl \ + unzip - name: Install Build Wrapper uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4 From 9310ffae8b796a5f6321e2bea6be54a5565b2d3e Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 20:35:58 +1100 Subject: [PATCH 16/19] . --- cmake/TestRunner.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/TestRunner.cmake b/cmake/TestRunner.cmake index 3a19cfaf..b590467f 100644 --- a/cmake/TestRunner.cmake +++ b/cmake/TestRunner.cmake @@ -70,8 +70,8 @@ foreach(target ${all_targets}) add_custom_command( OUTPUT ${coverage_report} - COMMAND llvm-cov show --show-branches=count -Xdemangler c++filt - -instr-profile=${CMAKE_CURRENT_BINARY_DIR}/coverage.profdata $ > ${coverage_report} + COMMAND llvm-cov show --show-branches=count -Xdemangler c++filt -instr-profile=${indexed_coverage} + $ > ${coverage_report} DEPENDS ${indexed_coverage} ) endif() From 416b1f2fdbb86faa0fa4462a63143d4eff4bbb6f Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 20:39:31 +1100 Subject: [PATCH 17/19] . --- .github/workflows/sonarcloud.yaml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 0ebcceae..5ed4ae54 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -27,16 +27,6 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Install Prerequisites - run: | - apt-get update - apt-get install -y --no-install-recommends \ - curl \ - unzip - - - name: Install Build Wrapper - uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4 - - name: Install CMake uses: lukka/get-cmake@v3.30.5 with: @@ -90,18 +80,18 @@ jobs: retention-days: 1 # This sets the artifact TTL to 1 day (minimum is 1 day) overwrite: true - - name: Run sonar-scanner + - name: SonarQube Scan + uses: SonarSource/sonarqube-scan-action@ if: ${{ !cancelled() }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - sonar-scanner \ - --define sonar.projectKey=Fastcode_NUClear \ - --define sonar.organization=fastcode \ - --define sonar.sources=src \ - --define sonar.tests=tests \ - --define sonar.cfamily.compile-commands=build/compile_commands.json \ + with: + args: > + --define sonar.projectKey=Fastcode_NUClear + --define sonar.organization=fastcode + --define sonar.sources=src + --define sonar.tests=tests + --define sonar.cfamily.compile-commands=build/compile_commands.json --define sonar.cfamily.llvm-cov.reportPath=build/reports/coverage.txt - name: Upload Traces From 061f1fa4f93933532dce82b29c2d903b51274f0e Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Fri, 14 Feb 2025 20:40:19 +1100 Subject: [PATCH 18/19] . --- .github/workflows/sonarcloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 5ed4ae54..19d6f72e 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -81,7 +81,7 @@ jobs: overwrite: true - name: SonarQube Scan - uses: SonarSource/sonarqube-scan-action@ + uses: SonarSource/sonarqube-scan-action@v4 if: ${{ !cancelled() }} env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 82ecb2e22aecef94c79d0dae368ad6f514de5a64 Mon Sep 17 00:00:00 2001 From: Trent Houliston Date: Mon, 17 Feb 2025 20:29:21 +1100 Subject: [PATCH 19/19] . --- .github/workflows/sonarcloud.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 19d6f72e..54073efd 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -27,6 +27,13 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install Prerequisites + run: | + apt-get update + apt-get install -y \ + ccache \ + unzip + - name: Install CMake uses: lukka/get-cmake@v3.30.5 with: