chore: Use new SonarCloud action

refactor: Rename job from 'sonarcloud-analysis' to 'analyze' in SonarCloud workflow

refactor: Reorder SonarQube scan and build wrapper installation steps in SonarCloud workflow

refactor: Update SonarQube scan step to use new action and streamline options

fix: Update SonarQube scan step to correctly pass coverage report paths and environment variables

fix: Set CPU core count to a fixed value in SonarCloud analysis workflow

refactor: Move 'Install Build Wrapper' step to the correct position in the SonarCloud analysis workflow

refactor: Remove unused Sonar Scanner environment variables from analysis workflow
This commit is contained in:
Nick Bolton
2025-10-09 09:53:32 +01:00
committed by Chris Rizzitello
parent 4fb76bec41
commit 47662c359e
3 changed files with 10 additions and 12 deletions

View File

@ -21,7 +21,6 @@ jobs:
analyze:
if: ${{ !github.event.pull_request.draft }}
name: Analyze
runs-on: ubuntu-latest
container: debian:trixie-slim
timeout-minutes: 20

View File

@ -26,10 +26,7 @@ jobs:
timeout-minutes: 20
env:
SONAR_SCANNER_VERSION: 6.1.0.4477
SONAR_SCANNER_OPTS: -server
SONAR_SCANNER_URL_BASE: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli
CPU_CORE_COUNT: ${{ vars.SONAR_SCANNER_CPU_COUNT || 4 }}
CPU_CORE_COUNT: 4
steps:
- name: Install container dependencies
@ -45,8 +42,8 @@ jobs:
with:
like: "debian"
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v3
- name: Install Build Wrapper
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v6
- name: Configure
run: |
@ -81,11 +78,11 @@ jobs:
fi
echo "csv=$paths" >> $GITHUB_OUTPUT
- name: Run SonarScanner
run: |
export PATH=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux-x64/bin:$PATH
sonar-scanner \
-Dsonar.coverageReportPaths=${{ steps.coverage-paths.outputs.csv }} \
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v6
with:
args: >
-Dsonar.coverageReportPaths=${{ steps.coverage-paths.outputs.csv }}
-Dsonar.cfamily.threads=${{ env.CPU_CORE_COUNT }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -78,6 +78,8 @@
"Serhii",
"shemp",
"SNAPPROCESS",
"sonarcloud",
"sonarqube",
"Sorin",
"subproject",
"subprojects",