name: Android Detox on: [pull_request] jobs: build-android-experimental-play-debug: runs-on: macos-latest environment: SecretStore timeout-minutes: 240 steps: - name: Checkout uses: actions/checkout@v1 with: fetch-depth: 1 - name: Node uses: actions/setup-node@v1 - name: Install JDK 8 uses: actions/setup-java@v2 with: java-version: '8' distribution: 'adopt' - 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 --frozen-lockfile --network-timeout 100000 - name: Decode google-services.json env: FIREBASE_SECRET: ${{ secrets.GOOGLE_KEY }} run: echo $FIREBASE_SECRET > android/app/google-services.json - name: Build for detox run: | yarn detox build e2e --configuration android.experimental.play.emu.release - 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 detox test --configuration android.experimental.play.emu.release