Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b94f539
generate test action
TakuKobayashi Feb 22, 2021
b7ed0d8
fix command
TakuKobayashi Feb 22, 2021
caff35e
split test states
TakuKobayashi Feb 22, 2021
82dccec
execute no wait
TakuKobayashi Feb 23, 2021
e7beb9c
Revert "execute no wait"
TakuKobayashi Feb 23, 2021
6cdf463
fix android emulator command
TakuKobayashi Feb 23, 2021
65eac4c
check android-wait-for-emulator
TakuKobayashi Feb 23, 2021
7671180
edit device wait command
TakuKobayashi Feb 23, 2021
529d9aa
setup path
TakuKobayashi Feb 23, 2021
e71eae1
Revert "setup path"
TakuKobayashi Feb 23, 2021
6b1e399
use run test
TakuKobayashi Feb 23, 2021
70829f4
test mac os
TakuKobayashi Feb 23, 2021
1ec7132
test mac os
TakuKobayashi Feb 23, 2021
42f38ac
not work revert
TakuKobayashi Feb 23, 2021
791520c
execute android emulator ait sript
TakuKobayashi Feb 23, 2021
1346677
edit adb command path
TakuKobayashi Feb 23, 2021
6b83dc1
exec sudo
TakuKobayashi Feb 23, 2021
d9acbea
chmod +x
TakuKobayashi Feb 23, 2021
ffd0aac
hardwareAccelerated=true because use emulator x86
TakuKobayashi Feb 23, 2021
ea93b7e
yes snapshot
TakuKobayashi Feb 23, 2021
c1ed7ca
yes window
TakuKobayashi Feb 23, 2021
45e02d4
use library
TakuKobayashi Feb 24, 2021
4fa441e
fix
TakuKobayashi Feb 24, 2021
a29afc2
Revert "hardwareAccelerated=true because use emulator x86"
TakuKobayashi Feb 24, 2021
a0440c8
macos version
TakuKobayashi Feb 26, 2021
97e58e0
fix
TakuKobayashi Feb 26, 2021
7a1d46a
setup working-directory
TakuKobayashi Feb 26, 2021
e6cf5c0
fix
TakuKobayashi Feb 26, 2021
fd1d2a9
revert
TakuKobayashi Feb 26, 2021
081e765
only shell
TakuKobayashi Feb 26, 2021
d19bac8
fix standard
TakuKobayashi Feb 27, 2021
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
65 changes: 65 additions & 0 deletions .github/workflows/android-instrumented-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Android Instrumented Test

on:
push:


jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
compile-sdk: [30]
build-tools: [30.0.0]
sdk-tools: [4333796]

steps:
- uses: actions/checkout@v2
- name: setup ubuntu
run: |
sudo apt-get --quiet update --yes
sudo apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
- name: setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: download Android SDK
working-directory: ./Android
run: |
wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${{ matrix.sdk-tools }}.zip
unzip -d android-sdk-linux android-sdk.zip
sudo mkdir -p /root/.android
sudo touch /root/.android/repositories.cfg
echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${{ matrix.compile-sdk }}" >/dev/null
echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${{ matrix.build-tools }}" >/dev/null
export ANDROID_HOME=$PWD/android-sdk-linux
export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
chmod +x ./gradlew
set +o pipefail
yes | android-sdk-linux/tools/bin/sdkmanager --licenses
set -o pipefail
- name: install emulator
working-directory: ./Android
run: |
echo y | android-sdk-linux/tools/bin/sdkmanager --install "system-images;android-${{ matrix.compile-sdk }};google_apis;x86"
- name: create emulator device
working-directory: ./Android
run: |
echo no | android-sdk-linux/tools/bin/avdmanager create avd -n test_android_emulator -k "system-images;android-${{ matrix.compile-sdk }};google_apis;x86" --force
- name: start emulator
working-directory: ./Android
run: |
android-sdk-linux/emulator/emulator -avd test_android_emulator -no-snapshot-save -no-audio -no-boot-anim &
android-sdk-linux/platform-tools/adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do echo "Sleeping for 1s";sleep 1; done;'
android-sdk-linux/platform-tools/adb shell input keyevent 82 &
- name: execute test and report coverage
working-directory: ./Android
run: |
./gradlew createDebugCoverageReport
- uses: actions/upload-artifact@master
with:
name: outputs
path: Android/app/build/outputs/
26 changes: 26 additions & 0 deletions Android/android-wait-for-emulator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

#!/bin/bash

# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain

set +e

bootanim=""
failcounter=0
timeout_in_sec=360

until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`android-sdk-linux/platform-tools/adb -e shell getprop init.svc.bootanim 2>&1 &`
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
|| "$bootanim" =~ "running" ]]; then
let "failcounter += 1"
echo "Waiting for emulator to start"
if [[ $failcounter -gt timeout_in_sec ]]; then
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
exit 1
fi
fi
sleep 1
done

echo "Emulator is ready"