Skip to content

Commit 4dd26fe

Browse files
👷 Add CI job e2e_android
1 parent 456b14d commit 4dd26fe

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

.circleci/config.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
name: Install Detox Utils
159159
command: brew tap wix/brew && brew install applesimutils
160160
- run:
161-
name: Install node_modules
161+
name: Install Node Packages
162162
command: yarn
163163
- run:
164164
name: Fetch CocoaPods Specs
@@ -173,6 +173,65 @@ jobs:
173173
name: Detox - Run E2E Tests
174174
command: detox test --configuration ios.sim.release --cleanup
175175

176+
e2e_android:
177+
macos:
178+
xcode: "10.2.0"
179+
working_directory: ~/project/InstabugSample
180+
steps:
181+
- checkout:
182+
path: ~/project
183+
- run:
184+
name: Install Android SDK
185+
command: |
186+
HOMEBREW_NO_AUTO_UPDATE=1 brew tap homebrew/cask
187+
HOMEBREW_NO_AUTO_UPDATE=1 brew cask install android-sdk
188+
- run:
189+
name: Accept Android SDK Licenses
190+
command: (yes | sdkmanager --licenses) || true
191+
- run:
192+
name: Setup Android Environment Variables
193+
command: |
194+
echo 'export JAVA_HOME=`/usr/libexec/java_home -v 1.8`' >> $BASH_ENV
195+
echo 'export ANDROID_HOME=/usr/local/share/android-sdk' >> $BASH_ENV
196+
echo 'export ANDROID_SDK_ROOT=/usr/local/share/android-sdk' >> $BASH_ENV
197+
echo 'export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >> $BASH_ENV
198+
- run:
199+
name: SDK Manager - Download Emulator Image
200+
command: (yes | sdkmanager "platform-tools" "platforms;android-27" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;27.0.3" "system-images;android-27;google_apis;x86" "emulator" --verbose) || true
201+
- run:
202+
name: AVD Manager - Setup Emulator
203+
command: avdmanager create avd -n Nexus_6P_API_27 -k "system-images;android-27;google_apis;x86" -g google_apis -d "Nexus 6P"
204+
- run:
205+
name: Run Emulator in background
206+
command: /usr/local/share/android-sdk/emulator/emulator @Nexus_6P_API_27 -noaudio -no-boot-anim -no-window
207+
background: true
208+
- run:
209+
name: Install Node Packages
210+
command: sudo yarn
211+
- run:
212+
name: Generate Android Keystore
213+
command: cd android/app && keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=AA, OU=AA, O=AA, L=AA, S=AA, C=EG"
214+
- run:
215+
name: Make gradlew Executable
216+
command: cd android && chmod +x ./gradlew
217+
- run:
218+
name: Download Android Dependencies
219+
command: cd android && ./gradlew androidDependencies
220+
- run:
221+
name: Install Detox CLI
222+
command: sudo npm install -g detox-cli
223+
- run:
224+
name: Detox - Build Release App
225+
command: |
226+
sudo chmod -R 777 /Users/distiller/project/InstabugSample/node_modules/instabug-reactnative
227+
detox build --configuration android.emu.release
228+
- run:
229+
name: Detox - Run E2E Tests
230+
command: |
231+
sudo chmod -R 777 /Users/distiller/Library/Detox
232+
detox test --configuration android.emu.release --cleanup
233+
234+
176235
publish:
177236
macos:
178237
xcode: "10.1.0"
@@ -192,12 +251,16 @@ workflows:
192251
- test_sample
193252
- test_android
194253
- test_ios
254+
- e2e_ios
255+
- e2e_android
195256
- hold:
196257
requires:
197258
- test_module
198259
- test_sample
199260
- test_android
200261
- test_ios
262+
- e2e_ios
263+
- e2e_android
201264
type: approval
202265
filters:
203266
branches:

InstabugSample/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ dependencies {
176176
implementation 'org.webkit:android-jsc:+'
177177
}
178178

179-
// androidTestImplementation(project(path: ":detox"))
179+
// Detox
180180
implementation "androidx.annotation:annotation:1.1.0"
181181
androidTestImplementation('com.wix:detox:+') { transitive = true }
182182
androidTestImplementation 'junit:junit:4.12'

InstabugSample/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"build":
5858
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
5959
"type": "android.emulator",
60-
"name": "Pixel_2_API_27"
60+
"name": "Nexus_6P_API_27"
6161
}
6262
}
6363
}

0 commit comments

Comments
 (0)