Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce GMD + ATD #479

Merged
merged 14 commits into from
Jan 10, 2023
34 changes: 34 additions & 0 deletions .github/workflows/AndroidCIWithGmd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Android CI with GMD

on:
push:
branches:
- main
pull_request:

jobs:

android-ci:
runs-on: macos-latest

steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
thagikura marked this conversation as resolved.
Show resolved Hide resolved
java-version: '11'
- uses: actions/checkout@v2

- name: Setup Android SDK
uses: android-actions/setup-android@v2
thagikura marked this conversation as resolved.
Show resolved Hide resolved

- name: Run instrumented tests with GMD
continue-on-error: true
run: ./gradlew cleanManagedDevices --unused-only && ./gradlew pixel4api30DemoDebugAndroidTest -Dorg.gradle.workers.max=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" -Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true --info

- name: Upload test reports
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-reports
path: |
'**/*/build/reports/androidTests/'
10 changes: 10 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ android {
unitTests {
isIncludeAndroidResources = true
}
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
namespace = "com.google.samples.apps.nowinandroid"
}
Expand Down
13 changes: 13 additions & 0 deletions core/database/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ android {
testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner"
}
namespace = "com.google.samples.apps.nowinandroid.core.database"

testOptions {
thagikura marked this conversation as resolved.
Show resolved Hide resolved
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
}

dependencies {
Expand Down
13 changes: 13 additions & 0 deletions feature/bookmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ plugins {

android {
namespace = "com.google.samples.apps.nowinandroid.feature.bookmarks"

testOptions {
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
}

dependencies {
Expand Down
13 changes: 13 additions & 0 deletions feature/foryou/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ plugins {

android {
namespace = "com.google.samples.apps.nowinandroid.feature.foryou"

testOptions {
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
}

dependencies {
Expand Down
13 changes: 13 additions & 0 deletions feature/interests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,17 @@ plugins {
}
android {
namespace = "com.google.samples.apps.nowinandroid.feature.interests"

testOptions {
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
}
13 changes: 13 additions & 0 deletions feature/settings/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ plugins {

android {
namespace = "com.google.samples.apps.nowinandroid.feature.settings"

testOptions {
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
}
13 changes: 13 additions & 0 deletions feature/topic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ plugins {

android {
namespace = "com.google.samples.apps.nowinandroid.feature.topic"

testOptions {
managedDevices {
devices {
maybeCreate<com.android.build.api.dsl.ManagedVirtualDevice>("pixel4api30").apply {
device = "Pixel 4"
apiLevel = 30
// ATDs currently support only API level 30.
systemImageSource = "aosp-atd"
}
}
}
}
}

dependencies {
Expand Down