Sonar report doesn't work with Github Actions

  • ALM used: GitHub

  • CI system used : Github Actions

  • Languages of the repository: Java, Android

  • Steps to reproduce: As recommended on Sonarcloud, integrated required changes to code
    build.gradle

    plugins {
    id “org.sonarqube” version “3.2.0”
    }

    sonarqube {
    properties {
    property “sonar.projectKey”, “xxx”
    property “sonar.organization”, “xxx”
    property “sonar.host.url”, “https://sonarcloud.io
    }
    }

build.yml

    name: Build
    on:
      push:
        branches:
          - master
      pull_request:
        types: [opened, synchronize, reopened]
    jobs:
      build:
        name: Build
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v2
            with:
              fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
          - name: Set up JDK 11
            uses: actions/setup-java@v1
            with:
              java-version: 11
          - name: Cache SonarCloud packages
            uses: actions/cache@v1
            with:
              path: ~/.sonar/cache
              key: ${{ runner.os }}-sonar
              restore-keys: ${{ runner.os }}-sonar
          - name: Cache Gradle packages
            uses: actions/cache@v1
            with:
              path: ~/.gradle/caches
              key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
              restore-keys: ${{ runner.os }}-gradle
          - name: Build and analyze
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
              SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
            run: ./gradlew sonarqube 

The build log

Run ./gradlew sonarqube

[13](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:13)Downloading https://services.gradle.org/distributions/gradle-6.1.1-all.zip

[14](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:14)....................................................................................................................................

[15](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:15)Unzipping /home/runner/.gradle/wrapper/dists/gradle-6.1.1-all/cfmwm155h49vnt3hynmlrsdst/gradle-6.1.1-all.zip to /home/runner/.gradle/wrapper/dists/gradle-6.1.1-all/cfmwm155h49vnt3hynmlrsdst

[16](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:16)Set executable permissions for: /home/runner/.gradle/wrapper/dists/gradle-6.1.1-all/cfmwm155h49vnt3hynmlrsdst/gradle-6.1.1/bin/gradle

[17](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:17)

[18](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:18)Welcome to Gradle 6.1.1!

[19](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:19)

[20](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:20)Here are the highlights of this release:

[21](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:21) - Reusable dependency cache

[22](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:22) - Configurable compilation order between Groovy/Kotlin/Java/Scala

[23](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:23) - New sample projects in Gradle's documentation

[24](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:24)

[25](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:25)For more details see https://docs.gradle.org/6.1.1/release-notes.html

[26](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:26)

[27](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:27)Starting a Gradle Daemon (subsequent builds will be faster)

[28](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:28)> Task :app:preBuild UP-TO-DATE

[29](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:29)> Task :app:preDebugBuild UP-TO-DATE

[30](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:30)> Task :models:checksum

[31](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:31)> Task :models:list

[32](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:32)> Task :models:preBuild

[33](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:33)> Task :models:preDebugBuild

[34](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:34)> Task :models:compileDebugAidl NO-SOURCE

[35](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:35)> Task :app:compileDebugAidl NO-SOURCE

[36](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:36)> Task :models:packageDebugRenderscript NO-SOURCE

[37](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:37)> Task :app:compileDebugRenderscript NO-SOURCE

[38](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:38)> Task :app:generateDebugBuildConfig

[39](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:39)> Task :app:javaPreCompileDebug

[40](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:40)> Task :app:generateDebugResValues

[41](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:41)> Task :app:generateDebugResources

[42](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:42)> Task :models:compileDebugRenderscript NO-SOURCE

[43](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:43)> Task :models:generateDebugResValues

[44](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:44)> Task :models:generateDebugResources

[45](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:45)> Task :models:packageDebugResources

[46](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:46)> Task :app:mergeDebugResources

[47](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:47)> Task :app:createDebugCompatibleScreenManifests

[48](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:48)> Task :app:extractDeepLinksDebug

[49](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:49)> Task :models:extractDeepLinksDebug

[50](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:50)> Task :models:compileDebugLibraryResources

[51](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:51)> Task :models:processDebugManifest

[52](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:52)> Task :app:processDebugManifest

[53](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:53)> Task :models:parseDebugLocalResources

[54](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:54)> Task :models:generateDebugBuildConfig

[55](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:55)> Task :models:javaPreCompileDebug

[56](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:56)> Task :app:preDebugAndroidTestBuild SKIPPED

[57](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:57)> Task :app:compileDebugAndroidTestAidl NO-SOURCE

[58](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:58)> Task :app:processDebugAndroidTestManifest

[59](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:59)> Task :app:compileDebugAndroidTestRenderscript NO-SOURCE

[60](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:60)> Task :app:generateDebugAndroidTestBuildConfig

[61](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:61)> Task :app:javaPreCompileDebugAndroidTest

[62](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:62)> Task :app:generateDebugAndroidTestResValues

[63](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:63)> Task :models:generateDebugRFile

[64](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:64)> Task :app:processDebugResources

[65](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:65)> Task :models:compileDebugJavaWithJavac

[66](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:66)> Task :app:generateDebugAndroidTestResources

[67](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:67)> Task :app:mergeDebugAndroidTestResources

[68](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:68)> Task :models:bundleLibCompileToJarDebug

[69](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:69)Note: Some input files use or override a deprecated API.

[70](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:70)

[71](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:71)Note: Recompile with -Xlint:deprecation for details.

[72](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:72)Note: Some input files use unchecked or unsafe operations.

[73](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:73)Note: Recompile with -Xlint:unchecked for details.

[74](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:74)> Task :app:compileDebugJavaWithJavac

[75](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:75)

[76](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:76)> Task :app:bundleDebugClasses

[77](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:77)> Task :app:preDebugUnitTestBuild UP-TO-DATE

[78](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:78)> Task :app:javaPreCompileDebugUnitTest

[79](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:79)> Task :app:compileDebugUnitTestJavaWithJavac NO-SOURCE

[80](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:80)> Task :models:preDebugAndroidTestBuild

[81](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:81)> Task :models:compileDebugAndroidTestAidl NO-SOURCE

[82](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:82)> Task :models:processDebugAndroidTestManifest

[83](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:83)> Task :models:compileDebugAndroidTestRenderscript NO-SOURCE

[84](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:84)> Task :models:generateDebugAndroidTestBuildConfig

[85](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:85)> Task :models:javaPreCompileDebugAndroidTest

[86](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:86)> Task :models:generateDebugAndroidTestResValues

[87](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:87)> Task :models:generateDebugAndroidTestResources

[88](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:88)> Task :models:mergeDebugAndroidTestResources

[89](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:89)> Task :app:processDebugAndroidTestResources

[90](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:90)> Task :app:compileDebugAndroidTestJavaWithJavac

[91](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:91)> Task :models:preDebugUnitTestBuild

[92](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:92)> Task :models:processDebugAndroidTestResources

[93](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:93)> Task :models:compileDebugAndroidTestJavaWithJavac

[94](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:94)> Task :models:generateDebugUnitTestStubRFile

[95](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:95)> Task :models:javaPreCompileDebugUnitTest

[96](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:96)> Task :models:compileDebugUnitTestJavaWithJavac NO-SOURCE

[97](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:97)> Task :sonarqube

[98](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:98)Unable to import Android Lint report file(s):

[99](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:99)- /home/runner/work/***-speech2text-android/***-speech2text-android/app/build/outputs/lint-results.xml

[100](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:100)- /home/runner/work/***-speech2text-android/***-speech2text-android/app/build/reports/lint-results.xml

[101](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:101)The report file(s) can not be found. Check that the property 'sonar.androidLint.reportPaths' is correctly configured.

[102](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:102)Unable to import Android Lint report file(s):

[103](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:103)- /home/runner/work/***-speech2text-android/***-speech2text-android/models/build/outputs/lint-results.xml

[104](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:104)- /home/runner/work/***-speech2text-android/***-speech2text-android/models/build/reports/lint-results.xml

[105](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:105)The report file(s) can not be found. Check that the property 'sonar.androidLint.reportPaths' is correctly configured.

[106](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:106)Unable to import Android Lint report file(s):

[107](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:107)- /home/runner/work/***-speech2text-android/***-speech2text-android/build/outputs/lint-results.xml

[108](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:108)- /home/runner/work/***-speech2text-android/***-speech2text-android/build/reports/lint-results.xml

[109](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:109)The report file(s) can not be found. Check that the property 'sonar.androidLint.reportPaths' is correctly configured.

[110](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:110)

[111](https://github.com/IMRSVDataLabs/ussocom-19-1-speech2text-android/runs/2502384774#step:8:111)BUILD SUCCESSFUL in 1m 22s

The sonar report doesn’t report bugs/security vulnerabilities though(0 bugs) which isn’t true as tested on local

Hello @Neha_Kapila ,

  1. Could you run your pipeline again with Gradle in debug mode and send the log as attachment, not inline please.

  • What do you mean by “as tested on local” ? Do you run something locally that produces an output with bugs and vulnerabilities ?
  • This local run, is it simply Android Lint execution or you have something like a local SonarQube community edition (or another edition) running ?

Olivier