How i can integrate SonarQube in my Gradle for Github Action?

I wrote yaml like below :

name: Kompas Sonarqube
on:
  push:
    branches:
      - POC/60822/main-sonarqube # or the name of your main branch

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.0.1
      - name: Cache SonarQube 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 }}
          SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
        run: ./gradlew build sonarqube --info

I tried to push it and run this yml. But I got problems affter long time like this :

2022-11-19T22:29:22.7140119Z AAPT2 aapt2-7.1.3-7984345-linux Daemon #3: shutdown
2022-11-19T22:29:22.7141232Z ----- End of the daemon log -----
2022-11-19T22:29:22.7141576Z 
2022-11-19T22:29:22.9731845Z 
2022-11-19T22:29:22.9732481Z FAILURE: Build failed with an exception.
2022-11-19T22:29:22.9732747Z 
2022-11-19T22:29:22.9732867Z * What went wrong:
2022-11-19T22:29:22.9733408Z Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
2022-11-19T22:29:22.9733710Z 
2022-11-19T22:29:22.9733804Z * Try:
2022-11-19T22:29:22.9734612Z Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
2022-11-19T22:29:22.9735241Z 
2022-11-19T22:29:22.9737129Z * Get more help at https://help.gradle.org
2022-11-19T22:29:23.1470262Z ##[error]Process completed with exit code 1.

How to solve this because i already set daemon to false and already run manually in my pc still got this in github action?

Note:
this log to help me analyze it
logs_3566.zip (3.4 MB)

Hi,

I’m not seeing anything in your log related to SonarQube analysis. It looks like a problem with compiling(?)

2022-11-19T22:29:22.7118656Z [KOTLIN] Kotlin compilation 'jdkHome' argument: null
2022-11-19T22:29:22.7119160Z i: found daemon on port 17650 (1005758 ms old), trying to connect
2022-11-19T22:29:22.7119605Z i: connected to the daemon
2022-11-19T22:29:22.7132380Z Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0], reportSeverity=2, requestedCompilationResults=[0]kotlinScriptExtensions=[]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, classpathChanges=ClasspathSnapshotDisabled, workingDir=/home/runner/work/kompas-mobile-android/kompas-mobile-android/app/build/kotlin/kaptGenerateStubsProdReleaseKotlin/cacheable, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=/home/runner/work/kompas-mobile-android/kompas-mobile-android/app/build/kotlin/kaptGenerateStubsProdReleaseKotlin/local-state/build-history.bin, useModuleDetection=true), usePreciseJavaTracking=trueoutputFiles=[/home/runner/work/kompas-mobile-android/kompas-mobile-android/app/build/tmp/kapt3/incrementalData/prodRelease, /home/runner/work/kompas-mobile-android/kompas-mobile-android/app/build/tmp/kapt3/stubs/prodRelease, /home/runner/work/kompas-mobile-android/kompas-mobile-android/app/build/kotlin/kaptGenerateStubsProdReleaseKotlin/cacheable, /home/runner/work/kompas-mobile-android/kompas-mobile-android/app/build/kotlin/kaptGenerateStubsProdReleaseKotlin/local-state])
2022-11-19T22:29:22.7140148Z AAPT2 aapt2-7.1.3-7984345-linux Daemon #3: shutdown
2022-11-19T22:29:22.7141242Z ----- End of the daemon log -----
2022-11-19T22:29:22.7141582Z 
2022-11-19T22:29:22.9731902Z 
2022-11-19T22:29:22.9732488Z FAILURE: Build failed with an exception.

 
Ann

So it caused by github action?

Hi,

If I’m assigning blame, I would say it’s “caused by” a compile problem.

 
Ann