Skip to content

Instantly share code, notes, and snippets.

@pedrorosarioo
Last active October 29, 2021 17:05
Show Gist options
  • Save pedrorosarioo/07658edc8983bce30c0098bcf90ce264 to your computer and use it in GitHub Desktop.
Save pedrorosarioo/07658edc8983bce30c0098bcf90ce264 to your computer and use it in GitHub Desktop.
name: Detox E2E Test - Android
# on: ...
jobs:
e2e-android:
name: E2E-Android
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Use specific Java version for sdkmanager to work
uses: joschi/setup-jdk@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
java-version: 'openjdk8'
architecture: 'x64'
- name: Download Android Emulator Image
run: |
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-27;google_apis;x86"
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd --force --name E2E_Emulator --device "Nexus 5" -k 'system-images;android-27;google_apis;x86'
$ANDROID_HOME/emulator/emulator -list-avds
- name: Install node_modules
run: |
yarn install --frozen-lockfile --network-timeout 100000
- name: Build for detox
run: |
yarn e2e:android-build
- name: Android Emulator
timeout-minutes: 10
continue-on-error: true
run: |
echo "Starting emulator"
nohup $ANDROID_HOME/emulator/emulator -avd E2E_Emulator -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 e2e:android-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment