From af1005114f86d752a5b0940ff79f1cefd8dd7dce Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 10:26:38 -0800 Subject: [PATCH 1/8] [Fix] Update SonarCloud scan action sonarsource/sonarcloud-github-c-cpp has been deprecated. sonarsource/SonarSource/sonarqube-scan-action is not favored. --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index ef4102b8..c0ad59c2 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -28,7 +28,7 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-9 g++-9 - name: Install sonar-scanner and build-wrapper - uses: sonarsource/sonarcloud-github-c-cpp@v3 + uses: sonarsource/SonarSource/sonarqube-scan-action@6.0.0 - name: Run build-wrapper run: | # here goes your compilation wrapped with build-wrapper; See https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/#analysis-steps-using-build-wrapper for more information From 77c32941b844e49a4000f6c3a7564a54e14fb12d Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 10:31:10 -0800 Subject: [PATCH 2/8] Fix capitalization --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index c0ad59c2..d110ed63 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -28,7 +28,7 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-9 g++-9 - name: Install sonar-scanner and build-wrapper - uses: sonarsource/SonarSource/sonarqube-scan-action@6.0.0 + uses: SonarSource/sonarqube-scan-action@6.0.0 - name: Run build-wrapper run: | # here goes your compilation wrapped with build-wrapper; See https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/#analysis-steps-using-build-wrapper for more information From deed21504cd8e2cf82c26921c775b3aeee20bae2 Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 10:32:24 -0800 Subject: [PATCH 3/8] Add the 'v' --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index d110ed63..1b23454b 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -28,7 +28,7 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-9 g++-9 - name: Install sonar-scanner and build-wrapper - uses: SonarSource/sonarqube-scan-action@6.0.0 + uses: SonarSource/sonarqube-scan-action@v6.0.0 - name: Run build-wrapper run: | # here goes your compilation wrapped with build-wrapper; See https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/#analysis-steps-using-build-wrapper for more information From 1b49da2694e26bacac63f6b20eca5cdcd56512c2 Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 10:45:01 -0800 Subject: [PATCH 4/8] Add scanner logs Following https://community.sonarsource.com/t/how-to-find-logs-about-importing-code-coverage/73317 --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1b23454b..a3013e56 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -50,5 +50,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.gcov.reportsPath="coverage-dir" + run: sonar-scanner -X --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.gcov.reportsPath="coverage-dir" # Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options From a0f644549380bbcd946d70c211abb1386365f213 Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 10:55:41 -0800 Subject: [PATCH 5/8] Following migration steps --- .github/workflows/sonarcloud.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index a3013e56..dd87f761 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -27,8 +27,8 @@ jobs: run: | sudo apt-get update sudo apt-get install -y gcc-9 g++-9 - - name: Install sonar-scanner and build-wrapper - uses: SonarSource/sonarqube-scan-action@v6.0.0 + - name: Install build-wrapper + uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6.0.0 - name: Run build-wrapper run: | # here goes your compilation wrapped with build-wrapper; See https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/#analysis-steps-using-build-wrapper for more information @@ -47,8 +47,10 @@ jobs: find ../build/test/CMakeFiles/test-aws-iot-device-client.dir/__/source -name '*.o' | xargs gcov-9 --preserve-paths cd .. - name: Run sonar-scanner + uses: SonarSource/sonarqube-scan-action@v6.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: sonar-scanner -X --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.gcov.reportsPath="coverage-dir" + # This is wrong and should break. Let's first get the build wrapper step working. + run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.gcov.reportsPath="coverage-dir" # Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options From d321fc7d483e3c6c6c936dd4e2e9967cc1d539bf Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 11:01:32 -0800 Subject: [PATCH 6/8] Update scan step to use args --- .github/workflows/sonarcloud.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index dd87f761..ebda0ed9 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -51,6 +51,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - # This is wrong and should break. Let's first get the build wrapper step working. - run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.gcov.reportsPath="coverage-dir" - # Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options + args: > + -Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} + -Dsonar.cfamily.gcov.reportsPath=coverage-dir From 2824dcad0930f69418bb4d25b4d50770b7a13dd1 Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 11:04:31 -0800 Subject: [PATCH 7/8] Add 'with' keyword --- .github/workflows/sonarcloud.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index ebda0ed9..dd90f414 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -51,6 +51,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - args: > - -Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} - -Dsonar.cfamily.gcov.reportsPath=coverage-dir + with: + args: > + -Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} + -Dsonar.cfamily.gcov.reportsPath=coverage-dir From 96520eaa118c2dff2bc9515f09864a044cb39c33 Mon Sep 17 00:00:00 2001 From: Kody Stribrny Date: Mon, 1 Dec 2025 11:13:07 -0800 Subject: [PATCH 8/8] Further cleanup --- .github/workflows/sonarcloud.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index dd90f414..1bebc63c 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -53,5 +53,5 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: args: > - -Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} - -Dsonar.cfamily.gcov.reportsPath=coverage-dir + --define "sonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }}" + --define sonar.cfamily.gcov.reportsPath=coverage-dir