7
7
instrumented-tests :
8
8
name : " Instrumented Tests"
9
9
timeout-minutes : 30
10
- runs-on : macos -latest
10
+ runs-on : ubuntu -latest
11
11
steps :
12
12
- name : " Checkout Branch"
13
13
uses : actions/checkout@v3
14
- - name : " Install JDK 11 "
14
+ - name : " Install JDK 17 "
15
15
uses : actions/setup-java@v3
16
16
with :
17
17
distribution : " zulu"
18
- java-version : " 11 "
18
+ java-version : " 17 "
19
19
- name : Gradle cache
20
20
uses : gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
21
21
- name : AVD cache
@@ -35,14 +35,23 @@ jobs:
35
35
emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
36
36
disable-animations : false
37
37
script : echo "Generated AVD snapshot for caching."
38
+ - name : Enable KVM group perms
39
+ run : |
40
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
41
+ sudo udevadm control --reload-rules
42
+ sudo udevadm trigger --name-match=kvm
38
43
- name : " Run Instrumented Tests"
39
44
uses : reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # v2.28.0
40
45
with :
41
46
api-level : 29
42
47
force-avd-creation : false
43
48
emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
44
49
disable-animations : true
45
- script : ./gradlew :android-core:cAT :android-kit-base:cAT --stacktrace
50
+ # script: ./gradlew :android-core:cAT :android-kit-base:cAT --stacktrace
51
+ script : |
52
+ # Disable benchmark tests as they do not work on emulators
53
+ adb uninstall com.mparticle.kits.test; ./gradlew connectedCheck --stacktrace
54
+ ./gradlew :android-core:cAT :android-kit-base:cAT -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=none
46
55
- name : " Archive Instrumented Tests Results"
47
56
uses : actions/upload-artifact@v3
48
57
if : always()
@@ -53,25 +62,18 @@ jobs:
53
62
instrumented-orchestrator-tests :
54
63
name : " Instrumented Orchestrator Tests"
55
64
timeout-minutes : 30
56
- runs-on : macos -latest
65
+ runs-on : ubuntu -latest
57
66
steps :
58
67
- name : " Checkout Branch"
59
68
uses : actions/checkout@v3
60
- - name : " Install JDK 11 "
69
+ - name : " Install JDK 17 "
61
70
uses : actions/setup-java@v3
62
71
with :
63
72
distribution : " zulu"
64
- java-version : " 11 "
73
+ java-version : " 17 "
65
74
- name : Gradle cache
66
75
uses : gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
67
- - name : AVD cache
68
- uses : actions/cache@v3
69
- id : avd-cache
70
- with :
71
- path : |
72
- ~/.android/avd/*
73
- ~/.android/adb*
74
- key : avd-29
76
+
75
77
- name : create AVD and generate snapshot for caching
76
78
if : steps.avd-cache.outputs.cache-hit != 'true'
77
79
uses : reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # v2.28.0
@@ -81,14 +83,22 @@ jobs:
81
83
emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
82
84
disable-animations : false
83
85
script : echo "Generated AVD snapshot for caching."
86
+ - name : Enable KVM group perms
87
+ run : |
88
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
89
+ sudo udevadm control --reload-rules
90
+ sudo udevadm trigger --name-match=kvm
84
91
- name : " Run Instrumented Orchestrator Tests"
85
92
uses : reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # v2.28.0
86
93
with :
87
94
api-level : 29
88
95
force-avd-creation : false
89
96
emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
90
97
disable-animations : true
91
- script : ./gradlew -Porchestrator=true :android-core:cAT --stacktrace
98
+ script : |
99
+ # Disable benchmark tests as they do not work on emulators
100
+ adb uninstall com.mparticle.test; ./gradlew connectedCheck --stacktrace
101
+ ./gradlew -Porchestrator=true :android-core:cAT -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=none
92
102
- name : " Archive Instrumented Orchestrator Tests Results"
93
103
uses : actions/upload-artifact@v3
94
104
if : always()
@@ -102,11 +112,11 @@ jobs:
102
112
steps :
103
113
- name : " Checkout Branch"
104
114
uses : actions/checkout@v3
105
- - name : " Install JDK 11 "
115
+ - name : " Install JDK 17 "
106
116
uses : actions/setup-java@v3
107
117
with :
108
118
distribution : " zulu"
109
- java-version : " 11 "
119
+ java-version : " 17 "
110
120
- name : " Run Unit Tests"
111
121
run : ./gradlew test
112
122
- name : " Print Android Unit Tests Report"
@@ -128,11 +138,11 @@ jobs:
128
138
uses : actions/checkout@v3
129
139
with :
130
140
submodules : recursive
131
- - name : " Install JDK 11 "
141
+ - name : " Install JDK 17 "
132
142
uses : actions/setup-java@v3
133
143
with :
134
144
distribution : " zulu"
135
- java-version : " 11 "
145
+ java-version : " 17 "
136
146
- name : " Run Android Core SDK Lint"
137
147
run : ./gradlew lint
138
148
- name : " Archive Lint Test Results"
@@ -151,11 +161,11 @@ jobs:
151
161
uses : actions/checkout@v3
152
162
with :
153
163
submodules : recursive
154
- - name : " Install JDK 11 "
164
+ - name : " Install JDK 17 "
155
165
uses : actions/setup-java@v3
156
166
with :
157
167
distribution : " zulu"
158
- java-version : " 11 "
168
+ java-version : " 17 "
159
169
- name : " Run Android Core SDK Kotlin Lint"
160
170
run : ./gradlew ktlintCheck
161
171
- name : " Archive Kotlin Lint Test Results"
@@ -181,11 +191,11 @@ jobs:
181
191
with :
182
192
submodules : recursive
183
193
fetch-depth : 0
184
- - name : " Install JDK 11 "
194
+ - name : " Install JDK 17 "
185
195
uses : actions/setup-java@v3
186
196
with :
187
197
distribution : " zulu"
188
- java-version : " 11 "
198
+ java-version : " 17 "
189
199
- name : " Get Latest Kits"
190
200
run : git submodule foreach "git rebase main"
191
201
- name : " Generate Core Release Build"
0 commit comments