diff --git a/.github/workflows/BuildAndRun.yaml b/.github/workflows/BuildAndRun.yaml index 2684d5b2091..5c269b443d1 100644 --- a/.github/workflows/BuildAndRun.yaml +++ b/.github/workflows/BuildAndRun.yaml @@ -76,6 +76,8 @@ jobs: - name: Install sonar-scanner and build-wrapper uses: sonarsource/sonarcloud-github-c-cpp@v3 + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - name: Build with SonarCloud Build Wrapper run: | @@ -114,13 +116,21 @@ jobs: path: lcov retention-days: 1 - - name: Run SonarCloud scan - uses: SonarSource/sonarcloud-github-action@master + # - name: Run SonarCloud scan + # uses: SonarSource/sonarcloud-github-action@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # with: + # projectBaseDir: ./src/scenario_simulator_v2 + + - name: Run sonar-scanner env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: ./src/scenario_simulator_v2 + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + working-directory: src/scenario_simulator_v2/ + run: sonar-scanner --define sonar.cfamily.compile-commands="bw-output/compile_commands.json" # - name: Debug # if: ${{ always() }} diff --git a/sonar-project.properties b/sonar-project.properties index 5dad8fa6a4e..e4c025b18c5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,5 +12,4 @@ sonar.exclusions=**/test/**,**/mock/** # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8 -sonar.cfamily.build-wrapper-output=bw-output sonar.cfamily.gcov.reportsPath=/lcov/total_coverage.info