Skip to content

Commit da6bdd3

Browse files
committed
Merge Sonar job into ccov job (#3621)
* Merge Sonar job into ccov job * Modernize Sonar Scanner invocation * Don't run if SONAR_TOKEN not available
1 parent 7659d82 commit da6bdd3

File tree

2 files changed

+5
-124
lines changed

2 files changed

+5
-124
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
CC: ${{ matrix.env.CLANG_TIDY && 'clang' }}
6868
CXX: ${{ matrix.env.CLANG_TIDY && 'clang++' }}
6969
ADDITIONAL_DEBS: lld
70+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7071

7172
name: ${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && ' + ccov' || ''}}${{ matrix.env.IKFAST_TEST && ' + ikfast' || ''}}${{ matrix.env.CLANG_TIDY && (github.event_name != 'workflow_dispatch' && ' + clang-tidy (delta)' || ' + clang-tidy (all)') || '' }}
7273
runs-on: ubuntu-latest
@@ -177,6 +178,10 @@ jobs:
177178
with:
178179
name: clang-tidy
179180
path: ${{ env.BASEDIR }}/target_ws/src/$(basename $(pwd))
181+
- name: SonarQube Scan
182+
# Don't run if SONAR_TOKEN is not set (i.e. PR job from a fork)
183+
if: matrix.env.CCOV && steps.ici.outputs.target_test_results == '0' && env.SONAR_TOKEN != ''
184+
uses: SonarSource/sonarqube-scan-action@v6.0.0
180185
- name: Prepare target_ws for cache
181186
if: always() && !matrix.env.CCOV
182187
run: |
@@ -190,7 +195,5 @@ jobs:
190195
uses: ./.github/workflows/docker_lint.yaml
191196
format:
192197
uses: ./.github/workflows/format.yaml
193-
sonar:
194-
uses: ./.github/workflows/sonar.yaml
195198
tutorial_docker:
196199
uses: ./.github/workflows/tutorial_docker.yaml

.github/workflows/sonar.yaml

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)