build(deps): bump the kotlin group across 1 directory with 2 updates #174
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SonarCloud Analysis | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| merge_group: | |
| permissions: | |
| contents: read | |
| jobs: | |
| sonarcloud: | |
| name: SonarCloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
| with: | |
| egress-policy: audit | |
| - name: Check out code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: gradle | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1 | |
| with: | |
| # The action's default is "tools platform-tools". `tools` is obsolete and Google | |
| # has delisted it, so sdkmanager exits 1 and fails the step. platform-tools is | |
| # installed again by "Install SDK components" below, so this loses nothing. | |
| packages: platform-tools | |
| # Setup KVM for hardware acceleration | |
| - name: Setup KVM | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils | |
| sudo adduser $USER kvm | |
| sudo chown $USER /dev/kvm | |
| sudo chmod 777 /dev/kvm | |
| # Accept Android SDK licenses | |
| - name: Accept Android SDK licenses | |
| run: yes | sdkmanager --licenses || true | |
| # Install required SDK components | |
| - name: Install SDK components | |
| run: | | |
| sdkmanager "platform-tools" "platforms;android-33" "system-images;android-33;google_apis;x86_64" | |
| sdkmanager --install "emulator" | |
| - name: Run Instrumented Tests | |
| uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2.34.0 | |
| with: | |
| api-level: 33 | |
| target: google_apis | |
| arch: x86_64 | |
| profile: pixel_6 | |
| force-avd-creation: true | |
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -accel on -no-snapshot | |
| disable-animations: true | |
| script: adb start-server && adb wait-for-device && until adb shell getprop sys.boot_completed 2>/dev/null | grep -q '^1$'; do echo "Waiting for boot completion..."; sleep 5; done && adb devices && ./gradlew jacocoAndroidTestReport && (adb emu kill || true) && sleep 5 | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| projectBaseDir: . | |
| args: > | |
| -Dsonar.organization=formbricks | |
| -Dsonar.projectKey=formbricks_android | |
| -Dsonar.java.binaries=android/build/tmp/kotlin-classes/debug | |
| -Dsonar.sources=android/src/main/java | |
| -Dsonar.tests=android/src/androidTest/java | |
| -Dsonar.coverage.jacoco.xmlReportPaths=android/build/reports/jacoco/jacocoAndroidTestReport/jacocoAndroidTestReport.xml | |
| -Dsonar.verbose=true |