diff --git a/.github/actions/setup-host/action.yml b/.github/actions/setup-host/action.yml index 7959750..8e2ea77 100644 --- a/.github/actions/setup-host/action.yml +++ b/.github/actions/setup-host/action.yml @@ -18,10 +18,18 @@ runs: uses: gradle/actions/setup-gradle@v3 with: cache-encryption-key: ${{ inputs.gradle-encryption-key }} + cache-read-only: false + - name: Add Android SDK to PATH + shell: bash + run: | + echo "ANDROID_HOME=$ANDROID_HOME" >> "$GITHUB_ENV" + echo "$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools" >> "$GITHUB_PATH" - name: Accept Android licences shell: bash - run: (yes || true) | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses - - # https://developer.android.com/studio/test/gradle-managed-devices#create_a_gradle_managed_device - name: Set `swiftshader_indirect` on Android Emulators (required by GHA) + run: yes | sdkmanager --licenses || true + - name: Enable Hardware Acceleration shell: bash - run: echo "android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect" >> ~/.gradle/gradle.properties + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1c2cdf7..9735c1a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/demo-project/app/build.gradle.kts b/demo-project/app/build.gradle.kts index 8329d41..00e31fe 100644 --- a/demo-project/app/build.gradle.kts +++ b/demo-project/app/build.gradle.kts @@ -43,11 +43,6 @@ android { } } - compileOptions { - sourceCompatibility(java.sourceCompatibility) - targetCompatibility(java.targetCompatibility) - } - testOptions { unitTests { isIncludeAndroidResources = true diff --git a/demo-project/login/build.gradle.kts b/demo-project/login/build.gradle.kts index 8d5b1cd..fa8048d 100644 --- a/demo-project/login/build.gradle.kts +++ b/demo-project/login/build.gradle.kts @@ -32,11 +32,6 @@ android { ) } } - - compileOptions { - sourceCompatibility(java.sourceCompatibility) - targetCompatibility(java.targetCompatibility) - } } dependencies { diff --git a/demo-project/ui-tests/build.gradle.kts b/demo-project/ui-tests/build.gradle.kts index 678d178..a85fb84 100644 --- a/demo-project/ui-tests/build.gradle.kts +++ b/demo-project/ui-tests/build.gradle.kts @@ -25,15 +25,15 @@ android { } } -val pixel2 by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) { - device = "Pixel 6" - apiLevel = 30 - systemImageSource = "aosp-atd" +val emulator by android.testOptions.managedDevices.devices.creating(ManagedVirtualDevice::class) { + device = "Pixel 2" + apiLevel = libs.versions.android.compileSDK.get().toInt() + systemImageSource = "aosp_atd" } baselineProfile { useConnectedDevices = false - managedDevices += pixel2.name + managedDevices += emulator.name } dependencies {