Skip to content

Commit

Permalink
SonarCloud test
Browse files Browse the repository at this point in the history
  • Loading branch information
npoltorapavlo committed Jan 17, 2023
1 parent ee97dc3 commit 1986fb6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
BUILD_TYPE: Debug
THUNDER_REF: "0731e67a8c9dea37a728201c9d19df5fbdfcbfe5"
INTERFACES_REF: "f61d710cc51628819d0fd80b8cc65e55eeec12b4"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory

jobs:
unit-tests:
Expand Down Expand Up @@ -197,8 +198,12 @@ jobs:
if: ${{ matrix.compiler == 'gcc' && matrix.coverage == 'with-coverage' && !env.ACT }}
run: echo "TOOLCHAIN_FILE=${{github.workspace}}/rdkservices/Tests/gcc-with-coverage.cmake" >> $GITHUB_ENV

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1

- name: Build rdkservices
run: >
build-wrapper-linux-x86-64 --out-dir "${{github.workspace}}/rdkservices/${{ env.BUILD_WRAPPER_OUT_DIR }}"
cmake
-S "${{github.workspace}}/rdkservices"
-B build/rdkservices
Expand Down Expand Up @@ -342,6 +347,15 @@ jobs:
-t "rdkservices coverage"
filtered_coverage.info
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
sonar-scanner -X
-Dproject.settings="${{github.workspace}}/rdkservices/sonar-project.properties"
--define sonar.cfamily.build-wrapper-output="${{github.workspace}}/rdkservices/${{ env.BUILD_WRAPPER_OUT_DIR }}"
- name: Upload artifacts
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
Expand Down
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=npoltorapavlo_rdkservices
sonar.organization=npoltorapavlo

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=rdkservices
#sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8

0 comments on commit 1986fb6

Please sign in to comment.