Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

add detox test workflow

Ammar Ahmed61b3414518f9
diff --git a/apps/mobile/.github/workflows/main.yml b/apps/mobile/.github/workflows/main.yml
new file mode 100644
index 000000000..6eab309f2
--- /dev/null
+++ b/apps/mobile/.github/workflows/main.yml
@@ -0,0 +1,47 @@
+name: Android
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: macos-latest
+ timeout-minutes: 15
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v1
+ with:
+ fetch-depth: 1
+
+ - name: Node
+ uses: actions/setup-node@v1
+
+ - name: Use specific Java version for sdkmanager to work
+ uses: joschi/setup-jdk@v1
+ with:
+ java-version: 'openjdk8'
+ architecture: 'x64'
+
+ - name: Download Android Emulator Image
+ run: |
+ echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-29;google_apis;x86"
+ echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name emu --device "Nexus 5X" -k 'system-images;android-29;google_apis;x86'
+ $ANDROID_HOME/emulator/emulator -list-avds
+ - name: Install node_modules
+ run: |
+ yarn install --frozen-lockfile
+
+ - name: Build for detox
+ run: |
+ yarn build-detox-android
+ - name: Android Emulator
+ timeout-minutes: 10
+ continue-on-error: true
+ run: |
+ echo "Starting emulator"
+ nohup $ANDROID_HOME/emulator/emulator -avd emu -no-audio -no-snapshot -no-window &
+ $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'
+ $ANDROID_HOME/platform-tools/adb devices
+ echo "Emulator started"
+ - name: Android Detox
+ run: yarn start & yarn test-detox-android