Skip to content

Commit

Permalink
genymotion-emulator-action
Browse files Browse the repository at this point in the history
  • Loading branch information
Funkatronics authored Oct 17, 2023
1 parent 4470e94 commit 570c9ce
Showing 1 changed file with 32 additions and 39 deletions.
71 changes: 32 additions & 39 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down

0 comments on commit 570c9ce

Please sign in to comment.