From 00e47af7b6102c931aab4eb1c549adb7cb026b45 Mon Sep 17 00:00:00 2001 From: Daniel Fowler Date: Wed, 1 Nov 2023 16:46:26 +0700 Subject: [PATCH] wip --- .github/workflows/ci.yml | 11 ++++--- .github/workflows/coverage.yml | 58 ---------------------------------- 2 files changed, 7 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f95afdec..3b4319ded 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,3 @@ -# This workflow will build and test the project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - name: Android CI on: push @@ -27,6 +24,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 # required for SonarCloud - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -56,6 +55,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 # required for SonarCloud - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -88,13 +89,15 @@ jobs: - name: Run instrumentation tests uses: reactivecircus/android-emulator-runner@v2 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: api-level: ${{ matrix.api-level }} disable-animations: true force-avd-creation: false profile: Nexus 6 emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - script: ./gradlew sdk:connectedProductionDebugAndroidTest + script: ./gradlew sdk:connectedProductionDebugAndroidTest sdk:jacocoTestReport sdk:sonar - name: Upload test report if: always() diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 2e4e54e0a..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Code Coverage - -on: push - -jobs: - coverage-report: - name: Coverage Report - # Due to Android emulator issue on Ubuntu, we use macOS instead. - runs-on: macos-latest - strategy: - matrix: - api-level: [ 29 ] - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # required for SonarCloud - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.api-level }} - - - name: Create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - profile: Nexus 6 - script: echo "Generated AVD snapshot for caching." - - - name: Coverage report - uses: reactivecircus/android-emulator-runner@v2 - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - api-level: ${{ matrix.api-level }} - disable-animations: true - force-avd-creation: false - profile: Nexus 6 - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - script: ./gradlew sdk:jacocoTestReport sdk:sonar