Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Android Check to Github Actions #4440

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Android

on: [push]

jobs:
build:
runs-on: macos-12
timeout-minutes: 60

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'

- name: Set up JDK 11, Use specific Java version for sdkmanager to work
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
architecture: 'x64'

- name: Download Android Emulator Image
run: |
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install $PACKAGE
echo "no" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd --force --name Pixel_5 --device "pixel_5" --package $PACKAGE --sdcard 256M
# adb start-server
$ANDROID_HOME/emulator/emulator -list-avds
$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list device
$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager list avd
env:
PACKAGE: 'system-images;android-29;default;x86_64'

- name: Change Android Emulator settings
run: |
echo fs.inotify.max_user_watches=524288 | tee -a /etc/sysctl.conf && sysctl -p
mkdir -p /root/.android && touch /root/.android/repositories.cfg
echo "vm.heapSize=576" >> $AVD_PATH/config.ini
echo "hw.ramSize=2048" >> $AVD_PATH/config.ini
echo "disk.dataPartition.size=2048m" >> $AVD_PATH/config.ini
grep "size" $AVD_PATH/config.ini
env:
AVD_NAME: Pixel_5
AVD_PATH: /Users/runner/.android/avd/Pixel_5.avd

- name: Install node_modules
run: |
npm install

- name: Android Emulator
timeout-minutes: 10
continue-on-error: true
run: |
echo "Starting emulator"
nohup $ANDROID_HOME/emulator/emulator -verbose -no-audio -no-snapshot -no-window -gpu swiftshader_indirect @Pixel_5 &
# nohup $ANDROID_HOME/emulator/emulator -verbose -no-audio -no-snapshot -no-window -partition-size 2048 @Pixel_5 &
$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: Build for detox
run: |
npm run build:android-debug

- name: Android Detox
run: npm run test:android-debug