Skip to content

Commit 4565194

Browse files
committed
something: something
something Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
1 parent 678cbd5 commit 4565194

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ jobs:
6363
run: |
6464
west twister -T tests/ --enable-coverage --coverage-platform=native_sim -v --inline-logs --integration --enable-asan --enable-lsan --enable-ubsan
6565
66-
- name: Install sonar-scanner and build-wrapper
67-
uses: SonarSource/sonarcloud-github-c-cpp@v3
66+
- name: Install Build Wrapper
67+
uses: SonarSource/sonarqube-scan-action@v4
68+
with:
69+
install: build-wrapper
6870

6971
- name: Build and test
7072
working-directory: asset-tracker-template
@@ -76,38 +78,36 @@ jobs:
7678
run: |
7779
gcovr twister-out -v --merge-mode-functions=separate --exclude='twister-out|drivers' --sonarqube coverage.xml
7880
79-
- name: Run sonar-scanner on main
80-
working-directory: asset-tracker-template
81+
- name: Run SonarQube scan on main
8182
if: github.event_name != 'pull_request'
83+
uses: SonarSource/sonarqube-scan-action@v4
84+
with:
85+
projectBaseDir: asset-tracker-template
86+
args: >
87+
-Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }}
88+
-Dproject.settings=sonar-project.properties
89+
-Dsonar.coverageReportPaths=coverage.xml
90+
-Dsonar.inclusions=**/*.c,**/*.h
91+
-Dsonar.exclusions=tests/,drivers/sensor/*_dummy/
8292
env:
8393
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8494
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
85-
run: |
86-
sonar-scanner \
87-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
88-
--define project.settings=sonar-project.properties \
89-
--define sonar.coverageReportPaths=coverage.xml \
90-
--define sonar.inclusions=**/*.c,**/*.h \
91-
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/
9295

93-
- name: Run sonar-scanner on PR
94-
working-directory: asset-tracker-template
96+
- name: Run SonarQube scan on PR
9597
if: github.event_name == 'pull_request'
98+
uses: SonarSource/sonarqube-scan-action@v4
99+
with:
100+
projectBaseDir: asset-tracker-template
101+
args: >
102+
-Dsonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }}
103+
-Dproject.settings=sonar-project.properties
104+
-Dsonar.coverageReportPaths=coverage.xml
105+
-Dsonar.inclusions=**/*.c,**/*.h
106+
-Dsonar.exclusions=tests/,drivers/sensor/*_dummy/
107+
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
108+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
109+
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
110+
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
96111
env:
97112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98113
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
99-
PR_NUMBER: ${{ github.event.pull_request.number }}
100-
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
101-
BASE_REF: ${{ github.event.pull_request.base.ref }}
102-
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
103-
run: |
104-
sonar-scanner \
105-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
106-
--define project.settings=sonar-project.properties \
107-
--define sonar.coverageReportPaths=coverage.xml \
108-
--define sonar.inclusions=**/*.c,**/*.h \
109-
--define sonar.exclusions=tests/,drivers/sensor/*_dummy/ \
110-
--define sonar.scm.revision=${{ env.HEAD_SHA }} \
111-
--define sonar.pullrequest.key=${{ env.PR_NUMBER }} \
112-
--define sonar.pullrequest.branch=${{ env.PR_BRANCH }} \
113-
--define sonar.pullrequest.base=${{ env.BASE_REF }}

0 commit comments

Comments
 (0)