generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### To be filled by the PR creator: * A brief description of the changes made - * Do we have clean latest run report (Docker or Browserstack) attached with this PR? * [ ] Yes * [ ] No (Please explain why) * Does the PR contain changes to any core file? * [ ] Yes (Needs approval from at least 1 people) * [ ] No * Is it * [ ] New Testcase * [ ] Fix ### To be filled by the PR reviewer: * [ ] Verify the attached run report passed in GitHub Actions (Docker or Browserstack run) * General * [ ] Use the best strategy to locate the elements * [ ] Comments wherever the code is not readable by itself * [ ] Use of the right data structure for the use case * [ ] Reuse logic/functionality as much as possible * [ ] Cleanup of any test data that is generated by the tests * [ ] No static waits
- Loading branch information
Showing
2 changed files
with
102 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,12 +133,105 @@ jobs: | |
sleep 10 | ||
appium -v | ||
# - name: Android Emulator Runner Without SDK Setup | ||
# uses: RandyLutcavich/[email protected] | ||
# - name: Android Emulator Runner Without SDK Setup | ||
# uses: RandyLutcavich/[email protected] | ||
|
||
# - name: AVD cache | ||
# uses: actions/cache@v4 | ||
# id: avd-cache | ||
# with: | ||
# path: | | ||
# ~/.android/avd/* | ||
# ~/.android/adb* | ||
# key: avd-test | ||
# | ||
# - name: Run Android Emulator | ||
# id: run_emulator | ||
# if: steps.setup_dependencies.outcome == 'success' | ||
# uses: ReactiveCircus/android-emulator-runner@v2 | ||
# with: | ||
# api-level: 30 | ||
# force-avd-creation: false | ||
# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
# disable-animations: true | ||
# target: default | ||
# arch: x86_64 | ||
# script: echo "Generated AVD Started" | ||
# | ||
# - name: Run Android Emulator Again | ||
# id: run_emulator_again | ||
# if: steps.run_emulator.outcome == 'success' | ||
# run: | | ||
# echo "Running Emulator Again" | ||
# cd ~/Library/Android/sdk/emulator | ||
# ./emulator -list-avds | ||
# ./emulator -avd test -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
|
||
# - name: set up JDK 17 | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: '17' | ||
# distribution: 'temurin' | ||
# | ||
# - name: Setup Android SDK | ||
# uses: android-actions/setup-android@v3 | ||
# | ||
# - name: Create Android emulator | ||
# run: | | ||
# sdkmanager --install "system-images;android-31;google_apis;x86_64" | ||
# echo "no" | avdmanager --verbose create avd --force --name testAVD --abi google_apis/x86_64 --package 'system-images;android-31;google_apis;x86_64' | ||
# | ||
# - name: Launch Emulator | ||
# run: | | ||
# $ANDROID_SDK_ROOT/emulator/emulator -avd testAVD | ||
|
||
- name: Create Android emulator | ||
run: | | ||
brew install intel-haxm | ||
# Install AVD files | ||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-27;default;x86_64' | ||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --licenses | ||
# Create emulator | ||
$ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-27;default;x86_64' | ||
$ANDROID_HOME/emulator/emulator -list-avds | ||
if false; then | ||
emulator_config=~/.android/avd/Pixel_API_29_AOSP.avd/config.ini | ||
sed -i .bak 's/hw.lcd.density=.*/hw.lcd.density=480/' "$emulator_config" | ||
sed -i .bak 's/hw.lcd.height=.*/hw.lcd.height=2220/' "$emulator_config" | ||
sed -i .bak 's/hw.lcd.width=.*/hw.lcd.width=1080/' "$emulator_config" | ||
# Or, add new config | ||
if ! grep -q "hw.lcd.density" "$emulator_config"; then | ||
echo "hw.lcd.density=480" >> "$emulator_config" | ||
fi | ||
if ! grep -q "hw.lcd.height" "$emulator_config"; then | ||
echo "hw.lcd.height=2220" >> "$emulator_config" | ||
fi | ||
if ! grep -q "hw.lcd.width" "$emulator_config"; then | ||
echo "hw.lcd.width=1080" >> "$emulator_config" | ||
fi | ||
echo "Emulator settings ($emulator_config)" | ||
cat "$emulator_config" | ||
fi | ||
- name: Start Android emulator | ||
id: start_emulator | ||
run: | | ||
echo "Starting emulator and waiting for boot to complete...." | ||
ls -la $ANDROID_HOME/emulator | ||
nohup $ANDROID_HOME/tools/emulator -avd Pixel_API_29_AOSP -gpu host -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 & | ||
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do echo "wait..."; sleep 1; done; input keyevent 82' | ||
echo "Emulator has finished booting" | ||
$ANDROID_HOME/platform-tools/adb devices | ||
sleep 30 | ||
screencapture screenshot.jpg | ||
$ANDROID_HOME/platform-tools/adb exec-out screencap -p > emulator.png | ||
- name: Check out code | ||
id: co_code | ||
if: steps.install_driver.outcome == 'success' | ||
if: steps.start_emulator.outcome == 'success' | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup dependencies | ||
|
@@ -147,33 +240,9 @@ jobs: | |
run: | | ||
sh setup_install.sh | ||
- name: Run Android Emulator | ||
id: run_emulator | ||
if: steps.setup_dependencies.outcome == 'success' | ||
uses: ReactiveCircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 30 | ||
force-avd-creation: false | ||
emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
target: default | ||
arch: x86_64 | ||
script: echo "Generated AVD Started" | ||
|
||
- name: Run Android Emulator Again | ||
id: run_emulator_again | ||
if: steps.run_emulator.outcome == 'success' | ||
run: | | ||
echo "Running Emulator Again" | ||
cd ~/Library/Android/sdk/emulator | ||
sleep 5 | ||
./emulator -list-avds | ||
sleep 5 | ||
./emulator -avd test -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
- name: Run Tests | ||
id: run_manual_job | ||
if: steps.run_emulator_again.outcome == 'success' | ||
if: steps.setup_dependencies.outcome == 'success' | ||
run: | | ||
TAGS="${{ github.event.inputs.tags }}" | ||
env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters