Skip to content

Commit c80a360

Browse files
committed
Migrate to SonarQube's new scan action
The old sonarcloud-github-c-cpp action is deprecated.
1 parent ca49fa0 commit c80a360

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414

1515
jobs:
1616
linux:
17+
on: false
1718
runs-on: ubuntu-${{ matrix.os }}${{ matrix.arch == 'arm64' && '-arm' || '' }}
1819
strategy:
1920
fail-fast: false
@@ -219,6 +220,7 @@ jobs:
219220
if-no-files-found: error
220221

221222
mac:
223+
on: false
222224
runs-on: ${{ matrix.os }}
223225
env:
224226
CMAKE_BUILD_PARALLEL_LEVEL: ${{ matrix.os == 'macos-13' && 4 || 3 }}
@@ -438,6 +440,7 @@ jobs:
438440
if-no-files-found: error
439441

440442
win:
443+
on: false
441444
runs-on: windows-${{ matrix.os }}
442445
defaults: { run: { shell: cmd } }
443446
strategy:

.github/workflows/sonar.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@ jobs:
3333
sudo apt update
3434
sudo apt upgrade
3535
sudo apt install qtbase5{,-doc}-dev qtconnectivity5-{dev,doc-html} qttools5-dev{,-tools}
36-
- name: Install sonar-scanner and build-wrapper
37-
uses: SonarSource/sonarcloud-github-c-cpp@v3
38-
- name: Run build-wrapper
36+
- name: Install SonarQube build wrapper
37+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5
38+
- name: Build with SonarQube wrapper
3939
env:
4040
CC: ${{ matrix.env.cc }}
4141
CXX: ${{ matrix.env.cxx }}
4242
PROJECT_BUILD_ID: ${{ github.run_number }}.linux.x86-64.${{ matrix.env.cc }}
4343
run: |
4444
cmake -D CMAKE_BUILD_TYPE=Release -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
4545
build-wrapper-linux-x86-64 --out-dir "$RUNNER_TEMP/sonar" cmake --build "$RUNNER_TEMP" --config Release
46-
- name: Run sonar-scanner
46+
- name: Scan with SonarQube
4747
if: github.actor != 'dependabot[bot]'
48+
uses: SonarSource/sonarqube-scan-action@v5
4849
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
51-
run: |
52-
sonar-scanner --define project.settings=.sonar.properties \
51+
with:
52+
args: >-
53+
--define project.settings=.sonar.properties
5354
--define sonar.cfamily.compile-commands="$RUNNER_TEMP/sonar/compile_commands.json"

0 commit comments

Comments
 (0)