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 41208f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .github/actions/setup-host/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ runs:
uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ inputs.gradle-encryption-key }}
- name: Add Android SDK to PATH
shell: bash
run: |
echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV"
echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> "$GITHUB_PATH"
- name: Accept Android licences
shell: bash
run: (yes || true) | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
run: yes | 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
4 changes: 2 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 @@ -27,7 +27,7 @@ jobs:
with:
gradle-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Test & Build
run: ./gradlew -s build
run: ./gradlew -si :demo-project:ui-tests:emulatorSetup
- name: Publish Test Report
uses: gmazzo/publish-report-annotations@v1
if: always()
Expand Down
6 changes: 3 additions & 3 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) {
device = "Pixel 6"
val emulator by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) {
device = "Pixel 2"
apiLevel = 30
systemImageSource = "aosp-atd"
}

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

dependencies {
Expand Down

0 comments on commit 41208f1

Please sign in to comment.