verdnatura-chat/.github/workflows/android_detox.yml

73 lines
2.8 KiB
YAML
Raw Normal View History

2021-04-05 12:04:53 +00:00
name: Android Detox
on: [pull_request]
jobs:
build-android-experimental-play-debug:
runs-on: macos-latest
2021-04-06 17:28:19 +00:00
environment: SecretStore
2021-04-06 16:02:11 +00:00
timeout-minutes: 240
2021-04-05 12:04:53 +00:00
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Node
uses: actions/setup-node@v1
2021-04-05 12:22:04 +00:00
- name: Install JDK 8
uses: actions/setup-java@v2
2021-04-05 12:04:53 +00:00
with:
2021-04-05 12:22:04 +00:00
java-version: '8'
distribution: 'adopt'
2021-04-05 12:04:53 +00:00
- 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: |
2021-04-05 14:22:52 +00:00
yarn --frozen-lockfile --network-timeout 100000
2021-04-06 17:20:25 +00:00
- name: Decode google-services.json
env:
FIREBASE_SECRET: ${{ secrets.GOOGLE_KEY }}
run: echo $FIREBASE_SECRET > android/app/google-services.json
2021-04-05 12:04:53 +00:00
2021-04-07 16:55:59 +00:00
- name: Generate Temporary Keystore
run: |
2021-04-07 18:35:35 +00:00
cd android
echo -e "" > ./gradle.properties
2021-04-08 06:52:08 +00:00
echo -e "android.useAndroidX=true" >> ./gradle.properties
echo -e "android.enableJetifier=true" >> ./gradle.properties
echo -e "FLIPPER_VERSION=0.51.0" >> ./gradle.properties
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
2021-04-08 07:39:16 +00:00
echo -e "VERSIONCODE=999999999" >> ./gradle.
echo -e "BugsnagAPIKey=invalid" >> ./gradle.properties
2021-04-07 18:35:35 +00:00
echo -e "KEYSTORE=debug.keystore" >> ./gradle.properties
echo -e "KEYSTORE_PASSWORD=android" >> ./gradle.properties
echo -e "KEY_ALIAS=androiddebugkey" >> ./gradle.properties
echo -e "KEY_PASSWORD=android" >> ./gradle.properties
cd ..
2021-04-07 16:55:59 +00:00
keytool -genkey -noprompt -dname "CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown" -keystore android/app/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
2021-04-05 12:04:53 +00:00
- name: Build for detox
run: |
2021-04-06 16:25:56 +00:00
yarn detox build e2e --configuration android.experimental.play.emu.release
2021-04-05 12:04:53 +00:00
- 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
2021-04-06 16:25:56 +00:00
run: yarn start & yarn detox test --configuration android.experimental.play.emu.release