2222 BUILD_TYPE : Debug
2323 BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory # Directory where build-wrapper output will be placed
2424
25- name : SonarCloud Workflow
25+ name : SonarQube Workflow
2626jobs :
2727 sonarcloud :
28- runs-on : ubuntu-22 .04
28+ runs-on : ubuntu-24 .04
2929 steps :
3030 - uses : actions/checkout@v6
3131 with :
@@ -51,24 +51,14 @@ jobs:
5151 cmake -E make_directory ${{github.workspace}}/build
5252 echo $PATH
5353
54- - name : Get Sonar Build Wrapper
55- shell : bash
56- working-directory : ${{github.workspace}}/build
57- run : |
58- set -ex
59- wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
60- unzip build-wrapper-linux-x86.zip
61- mv build-wrapper-linux-x86/* .
62-
54+ - name : Install Build Wrapper
55+ uses : SonarSource/sonarqube-scan-action/install-build-wrapper@v7
56+
6357 - name : Configure CMake
6458 # Use a bash shell so we can use the same syntax for environment variable
6559 # access regardless of the host operating system
6660 shell : bash
67- working-directory : ${{github.workspace}}/build
68- run : cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE
69-
70- - name : Install sonar-scanner and build-wrapper
71- uses : SonarSource/sonarcloud-github-c-cpp@v2
61+ run : cmake -S . -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE
7262
7363 - name : Build
7464 working-directory : ${{github.workspace}}/build
@@ -94,11 +84,12 @@ jobs:
9484 ls -la ${{ github.workspace }}/build
9585 ls -la ${{ github.workspace }}/build/coverage
9686
97- - name : Run sonar-scanner
87+ - name : SonarQube Scan
88+ uses : SonarSource/sonarqube-scan-action@v7
9889 env :
99- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10090 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
101- run : |
102- sonar-scanner \
91+ SONAR_ROOT_CERT : ${{ secrets.SONAR_ROOT_CERT }}
92+ with :
93+ args : >
10394 -Dsonar.cfamily.build-wrapper-output="${{github.workspace}}/build/${{ env.BUILD_WRAPPER_OUT_DIR }}" \
10495 -Dsonar.coverageReportPaths=${{github.workspace}}/build/coverage/sonarqube.report
0 commit comments