Skip to content

Commit b986037

Browse files
Adds GMD to main
Adds GMD to main
2 parents 8acf8d0 + 193da58 commit b986037

File tree

5 files changed

+69
-38
lines changed

5 files changed

+69
-38
lines changed

.github/workflows/blueprints.yaml

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-latest
16-
timeout-minutes: 30
15+
runs-on: macos-latest # Needed for emulators
16+
timeout-minutes: 45
1717

1818
steps:
1919
- name: Checkout
@@ -35,47 +35,46 @@ jobs:
3535
~/.gradle/caches/build-cache-*
3636
key: gradle-${{ hashFiles('checksum.txt') }}
3737

38-
- name: Build project
39-
run: ./gradlew spotlessCheck assembleMockDebug assembleProdDebug testMockDebugUnitTest testProdDebugUnitTest --stacktrace
38+
- name: Build project Mock and UnitTest
39+
run: ./gradlew assembleMockDebug assembleProdDebug compileMockDebugUnitTestKotlin
4040

41-
- name: Upload build reports
42-
if: always()
43-
uses: actions/upload-artifact@v2
44-
with:
45-
name: build-reports
46-
path: app/build/reports/
41+
- name: Spotless
42+
run: ./gradlew spotlessCheck
4743

48-
test:
49-
needs: build
50-
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
51-
timeout-minutes: 30
52-
strategy:
53-
matrix:
54-
api-level: [24, 29]
44+
- name: Robolectric Mock
45+
run: ./gradlew testMockDebugUnitTest
5546

56-
steps:
57-
- name: Checkout
58-
uses: actions/checkout@v2
47+
- name: Build project Prod and UnitTest
48+
run: ./gradlew assembleMockDebug assembleProdDebug compileProdDebugUnitTestKotlin
5949

60-
- name: Copy CI gradle.properties
61-
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
50+
- name: Robolectric Prod
51+
run: ./gradlew spotlessCheck assembleMockDebug assembleProdDebug testMockDebugUnitTest testProdDebugUnitTest --stacktrace
6252

63-
- name: Set up JDK 11
64-
uses: actions/setup-java@v1
65-
with:
66-
java-version: 11
53+
# Needed to accept licenses
54+
- name: Setup Android SDK
55+
uses: android-actions/setup-android@v2
6756

68-
- name: Run instrumentation tests
69-
uses: reactivecircus/android-emulator-runner@v2
70-
with:
71-
api-level: ${{ matrix.api-level }}
72-
arch: x86
73-
disable-animations: true
74-
script: ./gradlew app:cMDAT --stacktrace
57+
- name: Compile AndroidTests Mock
58+
run: ./gradlew compileMockDebugAndroidTestKotlin
59+
60+
- name: Run all tests pixel 2 api 30 ATD
61+
working-directory: .
62+
run: ./gradlew -Pandroid.sdk.channel=3 -Pandroid.experimental.androidTest.numManagedDeviceShards=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" pixel2api30atdMockDebugAndroidTest
7563

76-
- name: Upload test reports
64+
- name: Run all tests pixel 2 api 30 non-ATD
65+
working-directory: .
66+
run: ./gradlew -Pandroid.sdk.channel=3 -Pandroid.experimental.androidTest.numManagedDeviceShards=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" pixel2api30MockDebugAndroidTest
67+
68+
- name: Upload build reports
7769
if: always()
7870
uses: actions/upload-artifact@v2
7971
with:
80-
name: test-reports
72+
name: build-reports
8173
path: app/build/reports/
74+
75+
- name: Upload all outputs
76+
if: failure()
77+
uses: actions/upload-artifact@v2
78+
with:
79+
name: outputs
80+
path: app/build/outputs/

app/build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,39 @@ android {
102102
composeOptions {
103103
kotlinCompilerExtensionVersion "$composeVersion"
104104
}
105+
106+
testOptions {
107+
devices {
108+
pixel2api30atd(com.android.build.api.dsl.ManagedVirtualDevice) {
109+
// Use device profiles you typically see in Android Studio
110+
device = "Pixel 2"
111+
apiLevel = 30
112+
// You can also specify "google" if you require Google Play Services.
113+
systemImageSource = "aosp-atd"
114+
abi = "x86"
115+
}
116+
pixel2api30(com.android.build.api.dsl.ManagedVirtualDevice) {
117+
// Use device profiles you typically see in Android Studio
118+
device = "Pixel 2"
119+
apiLevel = 30
120+
// You can also specify "google" if you require Google Play Services.
121+
systemImageSource = "aosp"
122+
abi = "x86"
123+
}
124+
pixel2api27(com.android.build.api.dsl.ManagedVirtualDevice) {
125+
device = "Pixel 2"
126+
apiLevel = 27
127+
systemImageSource = "aosp"
128+
abi = "x86"
129+
}
130+
nexus9api29(com.android.build.api.dsl.ManagedVirtualDevice) {
131+
device = "Nexus 9"
132+
apiLevel = 29
133+
systemImageSource = "aosp"
134+
abi = "x86"
135+
}
136+
}
137+
}
105138
}
106139

107140
/*

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.1.2'
10+
classpath 'com.android.tools.build:gradle:7.3.0-alpha07'
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1212
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
1313

gradle/wrapper/gradle-wrapper.jar

285 Bytes
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Feb 18 13:22:47 CET 2022
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
54
zipStoreBase=GRADLE_USER_HOME
65
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)