infra: run tests with emulator.wtf

pull/40/head
Madis Pink 3 years ago
parent ef42543b32
commit 9ad16565f3

@ -67,11 +67,8 @@ jobs:
androidTest:
needs: build
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
api-level: [23, 26, 30]
steps:
- name: Checkout
@ -97,18 +94,6 @@ jobs:
key: gradle-${{ hashFiles('checksum.txt') }}
- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
disable-animations: true
disk-size: 1500M
heap-size: 512M
script: ./gradlew connectedAndroidTest -x :benchmark:connectedBenchmarkAndroidTest
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
path: app/build/reports/androidTests
env:
EW_API_TOKEN: ${{ secrets.EW_API_TOKEN }}
run: ./gradlew testDebugWithEmulatorWtf

@ -21,6 +21,7 @@ plugins {
id("jacoco")
id("dagger.hilt.android.plugin")
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

@ -29,4 +29,5 @@ dependencies {
implementation(libs.android.gradlePlugin)
implementation(libs.kotlin.gradlePlugin)
implementation(libs.spotless.gradlePlugin)
implementation(libs.emulator.wtf.gradlePlugin)
}

@ -0,0 +1,27 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("wtf.emulator.gradle")
}
emulatorwtf {
devices.set(listOf(
mapOf("model" to "Pixel2", "version" to 23),
mapOf("model" to "Pixel2", "version" to 27),
mapOf("model" to "Pixel2", "version" to 31),
))
}

@ -22,6 +22,7 @@ buildscript {
dependencies {
classpath(libs.android.gradlePlugin)
classpath(libs.emulator.wtf.gradlePlugin)
classpath(libs.kotlin.gradlePlugin)
classpath(libs.kotlin.serializationPlugin)
classpath(libs.hilt.gradlePlugin)

@ -20,6 +20,7 @@ plugins {
id("dagger.hilt.android.plugin")
alias(libs.plugins.ksp)
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

@ -20,6 +20,7 @@ plugins {
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

@ -20,6 +20,7 @@ plugins {
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

@ -20,6 +20,7 @@ plugins {
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

@ -20,6 +20,7 @@ plugins {
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

@ -23,6 +23,7 @@ androidxTestExt = "1.1.2"
androidxUiAutomator = "2.2.0"
androidxWork = "2.7.1"
coil = "2.0.0-rc01"
emulatorWtfGradlePlugin = "0.0.9"
hilt = "2.41"
hiltExt = "1.0.0"
jacoco = "0.8.7"
@ -86,6 +87,7 @@ androidx-work-testing = { group = "androidx.work", name = "work-testing", versio
coil-kt = { group = "io.coil-kt", name = "coil", version.ref = "coil"}
coil-kt-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil"}
coil-kt-svg = { group = "io.coil-kt", name = "coil-svg", version.ref = "coil"}
emulator-wtf-gradlePlugin = { group = "wtf.emulator", name = "gradle-plugin", version.ref = "emulatorWtfGradlePlugin" }
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
hilt-ext-work = { group = "androidx.hilt", name = "hilt-work", version.ref = "hiltExt" }
hilt-ext-compiler = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltExt" }

@ -24,7 +24,7 @@ pluginManagement {
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
// Register the AndroidX snapshot repository first so snapshots don't attempt (and fail)
// to download from the non-snapshot repositories
@ -37,6 +37,11 @@ dependencyResolutionManagement {
}
google()
mavenCentral()
maven(url = "https://maven.emulator.wtf/releases/") {
content {
includeGroup("wtf.emulator")
}
}
}
}
rootProject.name = "nowinandroid"

@ -19,6 +19,7 @@ plugins {
kotlin("kapt")
id("dagger.hilt.android.plugin")
id("nowinandroid.spotless")
id("nowinandroid.wtf.emulator")
}
android {

Loading…
Cancel
Save