Skip to content

Commit

Permalink
Accept licences on workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Nov 12, 2023
1 parent 8fa862b commit 50af0af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/setup-host/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ runs:
- name: Expose `ANDROID_HOME`
shell: bash
run: echo ANDROID_HOME=$ANDROID_HOME >> $GITHUB_ENV
- name: Cache Android SDK
- id: android-cache
name: Cache Android SDK
uses: actions/cache@v3
with:
key: ${{ runner.os }}/${{ runner.arch }}-android-sdk
path: ${{ env.ANDROID_HOME }}
- name: Accept Android licences
if: ${{ !steps.android-cache.cache-hit }}
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)
shell: bash
Expand Down
11 changes: 0 additions & 11 deletions demo-project/ui-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.android.build.api.dsl.ManagedVirtualDevice
import com.android.build.gradle.internal.tasks.ManagedDeviceInstrumentationTestSetupTask

plugins {
alias(libs.plugins.android.test)
Expand Down Expand Up @@ -49,13 +48,3 @@ dependencies {
implementation(libs.androidx.test.junit)
implementation(libs.androidx.test.espresso)
}

val acceptAndroidLicences by tasks.registering(Exec::class) {
val androidHome = androidComponents.sdkComponents.sdkDirectory.get().asFile.absolutePath

commandLine("bash", "-c", "yes | $androidHome/cmdline-tools/latest/bin/sdkmanager --licenses")
}

tasks.withType<ManagedDeviceInstrumentationTestSetupTask>().configureEach {
dependsOn(acceptAndroidLicences)
}

0 comments on commit 50af0af

Please sign in to comment.