Skip to content

Commit a70feb0

Browse files
authored
Merge pull request #1060 from PowerGridModel/feature/fix-sonar
CI: use sonarqube-scan-action instead of sonar-scanner
2 parents dd3bb19 + 56f0126 commit a70feb0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/sonar.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
uses: actions/setup-python@v5
4747
with:
4848
python-version: "3.12"
49-
- name: Install sonar-scanner and build-wrapper
50-
uses: SonarSource/sonarcloud-github-c-cpp@v3
49+
- name: Install build-wrapper
50+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5
5151

5252
- name: Python test and coverage
5353
run: |
@@ -70,11 +70,13 @@ jobs:
7070
# remove branch hits count, since it does not make sense in heavy C++ templates
7171
sed -i -r "s/\s*branchesToCover\s*=\s*\"[0-9]+\"\s+coveredBranches\s*=\s*\"[0-9]+\"//g" cpp_coverage.xml
7272
73-
- name: Run sonar-scanner
73+
- name: SonarQube Scan
7474
# only run sonar server in push event or pull request event from own repo
75-
if: ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
75+
if: ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
7676
env:
7777
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7878
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
79-
run: |
80-
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
79+
uses: SonarSource/sonarqube-scan-action@v5
80+
with:
81+
args: >
82+
--define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"

0 commit comments

Comments
 (0)