Skip to content

Commit

Permalink
Fixed emulator setup
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed May 14, 2024
1 parent cef1b30 commit 3c6137e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-host/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runs:
cache-encryption-key: ${{ inputs.gradle-encryption-key }}
- name: Accept Android licences
shell: bash
run: (yes || true) | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true
- # https://developer.android.com/studio/test/gradle-managed-devices#create_a_gradle_managed_device
name: Set `swiftshader_indirect` on Android Emulators (required by GHA)
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
build:
name: Build
runs-on: macos-latest # to use Android emulator
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -26,8 +26,10 @@ jobs:
uses: ./.github/actions/setup-host
with:
gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list | grep 'system-images;android-34;google'

Check failure on line 29 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflows

shellcheck reported issue in this script: SC2086:info:1:1: Double quote to prevent globbing and word splitting ``` - run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --list | grep 'system-images;android-34;google' ^~~~ ```
- run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager 'system-images;android-34;google_apis;x86_64'

Check failure on line 30 in .github/workflows/build.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflows

shellcheck reported issue in this script: SC2086:info:1:1: Double quote to prevent globbing and word splitting ``` - run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager 'system-images;android-34;google_apis;x86_64' ^~~~ ```
- name: Test & Build
run: ./gradlew -s build
run: ./gradlew -i :demo-project:ui-tests:emulatorSetup
- name: Publish Test Report
uses: gmazzo/publish-report-annotations@v1
if: always()
Expand Down
8 changes: 4 additions & 4 deletions demo-project/ui-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ android {
}
}

val pixel2 by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) {
val emulator by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) {
device = "Pixel 6"
apiLevel = 30
systemImageSource = "aosp-atd"
apiLevel = libs.versions.android.compileSDK.get().toInt()
systemImageSource = "google_apis"
}

baselineProfile {
useConnectedDevices = false
managedDevices += pixel2.name
managedDevices += emulator.name
}

dependencies {
Expand Down

0 comments on commit 3c6137e

Please sign in to comment.