From 570c9cee5daf4945431a588087214ef57d20025d Mon Sep 17 00:00:00 2001 From: Marco Martinez Date: Tue, 17 Oct 2023 10:15:42 -0600 Subject: [PATCH] genymotion-emulator-action --- .github/workflows/android.yml | 71 ++++++++++++++++------------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index d81e407cc..b812ac50a 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -101,63 +101,56 @@ jobs: run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -P version=${TAG:1} test: - runs-on: macos-latest + runs-on: ubuntu-latest needs: build strategy: matrix: - api-level: [28] + include: + - api-level: 27 + recipe_uuid: ea5fda48-fa8b-48c1-8acc-07d910856141 # Pixel XL, Android 8.1 (API 27) + # fb936099-d261-4dd3-8dec-3fc14f1d0f03 # Pixel 3a, Android 9.0 (API 28) + # 4c015ada-e64e-4f5d-a320-06cbf6e95648 # Pixel 3a, Android 10 (API 29) + # 95016679-8f8d-4890-b026-e4ad889aadf1 # Pixel 3a, Android 11 (API 30) + # see here for more recipes: https://support.genymotion.com/hc/en-us/articles/360007473658-Supported-Android-devices-templates-for-Genymotion-Cloud-SaaS steps: # Setup - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.9.16" + architecture: "x64" - name: set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' cache: gradle + - name: Setup Android SDK + uses: android-actions/setup-android@v2 # Caching - name: Gradle cache uses: gradle/gradle-build-action@v2 - - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache + + # Create Genymotion instance + - name: Start Genymotion Cloud SaaS instance + uses: genymobile/genymotion-saas-github-action@v0.3 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: - working-directory: android - api-level: ${{ matrix.api-level }} - target: google_apis - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." - - # Test - # Note: the fakedapp tests rely on fakewallet, so we always run the fakewallet - # tests first to ensure fakewallet is installed before the fakedapp tests - - name: run tests - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: android - api-level: ${{ matrix.api-level }} - target: google_apis - force-avd-creation: false - emulator-options: -no-snapshot-save -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - script: | - adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS - ./gradlew :fakewallet:connectedDebugAndroidTest - ./gradlew :fakewallet:installDebug :fakedapp:connectedDebugAndroidTest + email: ${{ secrets.GMSAAS_EMAIL }} + password: ${{ secrets.GMSAAS_PASSWORD }} + recipe_uuid: ${{ matrix.recipe_uuid }} + + # Run the tests + - name: Run Android Integration Tests + run: | + cd android + adb shell am broadcast -a android.intent.action.CLOSE_SYSTEM_DIALOGS + ./gradlew :fakewallet:connectedDebugAndroidTest + ./gradlew :fakedapp:connectedDebugAndroidTest + + # Archive test results - name: Archive fakewallet test results if: ${{ success() || failure() }} uses: actions/upload-artifact@v3