From dc6d1b2909629920c79fc76b1e712916b9ea4557 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Fri, 28 Apr 2023 22:43:04 +0530 Subject: [PATCH 001/107] init --- .github/workflows/build.yml | 296 +++++++++++++++++++++++++----------- 1 file changed, 207 insertions(+), 89 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7701762e..f4058566 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,94 +160,212 @@ jobs: name: build-files path: ${{ env.GRADLE_DIR }}/app/.cxx/ - # Test_APK: - # name: Test APK - # runs-on: macos-latest - # strategy: - # matrix: - # api-level: [29] - # steps: - # - name: checkout - # uses: actions/checkout@v3 - # with: - # submodules: 'true' - - # - name: Set Up JDK - # uses: actions/setup-java@v3 - # with: - # distribution: 'oracle' - # java-version: 17 - - # # Only for Testing github-actions - # - uses: actions-rs/toolchain@v1 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # profile: minimal - # toolchain: stable - # override: true - # components: clippy - # - uses: Swatinem/rust-cache@v2 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # cache-on-failure: true - # workspaces: ${{env.GRADLE_DIR}}/ALVR/ + Test_APK: + name: Test APK + runs-on: macos-latest + strategy: + matrix: + api-level: [29] + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Set Up JDK + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: 17 + + # Only for Testing github-actions + - uses: actions-rs/toolchain@v1 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: Swatinem/rust-cache@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + cache-on-failure: true + workspaces: ${{env.GRADLE_DIR}}/ALVR/ + + - uses: gradle/gradle-build-action@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + build-root-directory: ${{env.GRADLE_DIR}} + cache-read-only: ${{ false }} + + - name: Prepare deps + shell: bash + run: | + ls -alh + cd code/mobile/android/PhoneVR + chmod +x prepare-alvr-deps.sh + bash prepare-alvr-deps.sh + + - name: Change gradle wrapper permissions + run: | + cd code/mobile/android/PhoneVR + chmod +x ./gradlew + ls -alh + ls -alh app + + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} - # - uses: gradle/gradle-build-action@v2 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # build-root-directory: ${{env.GRADLE_DIR}} - # cache-read-only: ${{ false }} - - # - name: Prepare deps - # shell: bash - # run: | - # ls -alh - # cd code/mobile/android/PhoneVR - # chmod +x prepare-alvr-deps.sh - # bash prepare-alvr-deps.sh - - # - name: Change gradle wrapper permissions - # run: | - # cd code/mobile/android/PhoneVR - # chmod +x ./gradlew - # ls -alh - # ls -alh app - - # - name: AVD cache - # uses: actions/cache@v3 - # id: avd-cache - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} + # Cache APK gradle tasks + - name: Build apk debug project (APK) + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + script: echo "Generated AVD snapshot for caching." + + - name: Run tests + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + script: | + chmod +x /app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh + bash /app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh & + + adb logcat -v color & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb logcat > mobile/build/logcat.log + + # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + - uses: actions/upload-artifact@v3 + if: ${{ success() || steps.test.conclusion == 'failure'}} + with: + name: screenshots + path: | + **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - # # Cache APK Debug - # - name: Build apk debug project (APK) - # run: | - # cd code/mobile/android/PhoneVR - # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - # - name: create AVD and generate snapshot for caching - # if: steps.avd-cache.outputs.cache-hit != 'true' - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # force-avd-creation: false - # emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - # disable-animations: false - # script: echo "Generated AVD snapshot for caching." - - # - name: Run tests - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # force-avd-creation: false - # emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - # disable-animations: true - # script: | - # adb logcat -v color & - # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # adb logcat > mobile/build/logcat.log + # build/reports/androidTests/connected + - name: Publish Test Results in Comment + uses: EnricoMi/publish-unit-test-result-action@v2 + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + if: always() + with: + report_individual_runs: true + report_suite_logs: 'any' + deduplicate_classes_by_file_name: true + comment_title: '🛠 Test Results' + files: | + app/build/reports/androidTests/connected/**/*.xml + + - uses: iterative/setup-cml@v1 + if: always() + + - name: Publish Screenshots - Find Comment + if: always() + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.number }} + body-includes: '# 📷 Screenshots of tests:' + direction: last + comment-author: 'github-actions[bot]' + # TODO + - name: Publish Screenshots - build comment + if: always() + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EVENT: ${{ github.event_name }} + REF: ${{ github.ref }} + shell: bash + run: | + echo "# 📷 Screenshots of tests:" >> comment.md + echo "" >> comment.md + + for ss_test in logs/**/; do + ss_test_desc=$(basename "$ss_test" .png) + + if [ "$ss_test_desc" == "test-reports" ]; then + continue + fi + + echo "" >> comment.md + echo "### 🔧 $ss_test_desc" >> comment.md + echo "" >> comment.md + + echo '
Pre Test' >> comment.md + + for ss in "$ss_test"*Pre*.png; do + echo '

' >> comment.md + cml-publish "$ss" | sed -E 's/.+//' >> comment.md + echo '

' >> comment.md + done + + echo '
Post Test' >> comment.md + + for ss in "$ss_test"*Post*.png; do + echo '

' >> comment.md + cml-publish "$ss" | sed -E 's/.+//' >> comment.md + echo '

' >> comment.md + done + + echo '
' >> comment.md + done + + # for ss_test in tests/test_config/*.png logs/*.png; do + # ss_test_desc=$(basename "$ss_test" .png) + + # # echo "
$ss_test_desc" >> comment.md + # # echo '

' >> comment.md + # # cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md + # # # echo "![](./$ss_test)" >> comment.md + # # echo '

' >> comment.md + + # echo "" >> comment.md + # echo "### $ss_test_desc" >> comment.md + # echo "" >> comment.md + # echo '

' >> comment.md + # cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md + # # echo "![](./$ss_test)" >> comment.md + # echo '

' >> comment.md + # done + + if [ "$EVENT" == 'pull_request' ] + then + sha=${{ github.event.pull_request.head.sha}} + elif [ "$EVENT" == 'workflow_run' ] + then + sha=${{ github.event.workflow_run.head_sha}} + else + sha=$GITHUB_SHA + fi + + echo "" >> comment.md + echo "###### For commit $sha" >> comment.md + + - name: Publish Screehnshots - Update or Create Comment + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + body-file: comment.md + edit-mode: replace + issue-number: ${{ github.event.number }} From 4e2f1f341567717f2c628eceeddba70348ddd9be Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sat, 29 Apr 2023 13:24:07 +0530 Subject: [PATCH 002/107] Update build.yml --- .github/workflows/build.yml | 57 +++++++++++-------------------------- 1 file changed, 16 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4058566..0e832695 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,7 +263,7 @@ jobs: path: | **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - # build/reports/androidTests/connected + # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment uses: EnricoMi/publish-unit-test-result-action@v2 # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() @@ -274,7 +274,7 @@ jobs: deduplicate_classes_by_file_name: true comment_title: '🛠 Test Results' files: | - app/build/reports/androidTests/connected/**/*.xml + app/build/outputs/androidTest-results/**/TEST-*.xml - uses: iterative/setup-cml@v1 if: always() @@ -288,7 +288,7 @@ jobs: body-includes: '# 📷 Screenshots of tests:' direction: last comment-author: 'github-actions[bot]' - # TODO + - name: Publish Screenshots - build comment if: always() env: @@ -300,54 +300,29 @@ jobs: echo "# 📷 Screenshots of tests:" >> comment.md echo "" >> comment.md - for ss_test in logs/**/; do - ss_test_desc=$(basename "$ss_test" .png) - - if [ "$ss_test_desc" == "test-reports" ]; then - continue - fi + # for each AVD Image + for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + + $ss_test_avd_desc=$(basename "$ss_test_avd") echo "" >> comment.md - echo "### 🔧 $ss_test_desc" >> comment.md + echo "### 📱 $ss_test_avd_desc" >> comment.md echo "" >> comment.md - echo '
Pre Test' >> comment.md - - for ss in "$ss_test"*Pre*.png; do - echo '

' >> comment.md - cml-publish "$ss" | sed -E 's/.+//' >> comment.md - echo '

' >> comment.md - done - - echo '
Post Test' >> comment.md + # for each .png in that AVD folder + for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd/"*.png; do + + ss_test_desc=$(basename "$ss_test" .png) + + echo "#### 🔧 $ss_test_desc" >> comment.md - for ss in "$ss_test"*Post*.png; do echo '

' >> comment.md - cml-publish "$ss" | sed -E 's/.+//' >> comment.md + cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md echo '

' >> comment.md - done - echo '
' >> comment.md + done done - # for ss_test in tests/test_config/*.png logs/*.png; do - # ss_test_desc=$(basename "$ss_test" .png) - - # # echo "
$ss_test_desc" >> comment.md - # # echo '

' >> comment.md - # # cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md - # # # echo "![](./$ss_test)" >> comment.md - # # echo '

' >> comment.md - - # echo "" >> comment.md - # echo "### $ss_test_desc" >> comment.md - # echo "" >> comment.md - # echo '

' >> comment.md - # cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md - # # echo "![](./$ss_test)" >> comment.md - # echo '

' >> comment.md - # done - if [ "$EVENT" == 'pull_request' ] then sha=${{ github.event.pull_request.head.sha}} From d9dd36ecca61c7b794bc10c10319ca2ff0f0ef80 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sat, 29 Apr 2023 13:55:43 +0530 Subject: [PATCH 003/107] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e832695..dbee3c65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,7 +249,7 @@ jobs: disable-animations: true script: | chmod +x /app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh - bash /app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh & + bash app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh & adb logcat -v color & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} @@ -265,7 +265,7 @@ jobs: # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment - uses: EnricoMi/publish-unit-test-result-action@v2 + uses: EnricoMi/publish-unit-test-result-action/composite@v2 # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() if: always() with: @@ -303,7 +303,7 @@ jobs: # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do - $ss_test_avd_desc=$(basename "$ss_test_avd") + ss_test_avd_desc=$(basename "$ss_test_avd") echo "" >> comment.md echo "### 📱 $ss_test_avd_desc" >> comment.md From 77c0e36938d1850291352a06e77586635ba5d2eb Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sat, 29 Apr 2023 14:10:13 +0530 Subject: [PATCH 004/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbee3c65..ae057592 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,7 +248,7 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: | - chmod +x /app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh + chmod +x app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh bash app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh & adb logcat -v color & @@ -257,7 +257,7 @@ jobs: # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - uses: actions/upload-artifact@v3 - if: ${{ success() || steps.test.conclusion == 'failure'}} + if: always() with: name: screenshots path: | From bec3528c16773cce47fe9fe82f47bf6c6eb5604b Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sat, 29 Apr 2023 15:00:25 +0530 Subject: [PATCH 005/107] fix: gradle github-pr integration --- .github/workflows/build.yml | 8 +++++++- code/mobile/android/PhoneVR/app/build.gradle | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae057592..6e944785 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -234,6 +234,7 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} + target: google_apis force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -248,12 +249,17 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: | + brew install telnet + chmod +x app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh bash app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh & adb logcat -v color & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb logcat > mobile/build/logcat.log + adb logcat >> logcat.log + + killall `ps -aux | grep pvr-adb-telnet | grep -v grep | awk '{ print $1 }'` && killall inotifywait + # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - uses: actions/upload-artifact@v3 diff --git a/code/mobile/android/PhoneVR/app/build.gradle b/code/mobile/android/PhoneVR/app/build.gradle index 997b2193..449262a8 100644 --- a/code/mobile/android/PhoneVR/app/build.gradle +++ b/code/mobile/android/PhoneVR/app/build.gradle @@ -11,18 +11,21 @@ keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { signingConfigs { releaseconfig { - if( System.env.github && System.env.github.event_name && System.env.github.event_name == 'pull_request' ) { + if( System.getenv('GITHUB_EVENT_NAME') == 'pull_request' || System.getenv("Store") == null || System.getenv("Key") == null ) { // If its a PR Supply a dummy KeySigningConfig + // Or in Local env if Store and Keys are not present in ENV Vars do the same storeFile file("PhoneVRKeyStorePR.jks") storePassword "test1234" keyAlias "PhoneVRKeyPR" keyPassword "test1234" + println "Configuring releaseconfigs for testing a PR..." } else { storeFile file(keystoreProperties['storeFile']) storePassword System.getenv("Store") keyAlias keystoreProperties['keyAlias'] keyPassword System.getenv("Key") + println "Configuring releaseconfigs for release (push) (not a PR)" } } } From 75b909182d97311324301705708cfeacc447b2d8 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sat, 29 Apr 2023 15:07:07 +0530 Subject: [PATCH 006/107] Update build.yml --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e944785..019ea00c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -280,7 +280,7 @@ jobs: deduplicate_classes_by_file_name: true comment_title: '🛠 Test Results' files: | - app/build/outputs/androidTest-results/**/TEST-*.xml + code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml - uses: iterative/setup-cml@v1 if: always() @@ -302,6 +302,7 @@ jobs: EVENT: ${{ github.event_name }} REF: ${{ github.ref }} shell: bash + working-directory: ${{env.GRADLE_DIR}} run: | echo "# 📷 Screenshots of tests:" >> comment.md echo "" >> comment.md From 7b84b1af076405f518bd437db10c3411f9e69830 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sat, 29 Apr 2023 15:20:03 +0530 Subject: [PATCH 007/107] safe shutdown pvr-adb-telnet server --- .github/workflows/build.yml | 3 +-- .../java/viritualisres/phonevr/utils/pvr-adb-telnet.sh | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 019ea00c..f1e9f2e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -258,8 +258,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb logcat >> logcat.log - killall `ps -aux | grep pvr-adb-telnet | grep -v grep | awk '{ print $1 }'` && killall inotifywait - + echo meow >> app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sd # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - uses: actions/upload-artifact@v3 diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh index c576ed59..b8cec556 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh @@ -3,12 +3,14 @@ cmdFile="/data/data/viritualisres.phonevr/files/pvr-adb-telnet" # Will made and written by Android; Deleted by Server lockFile="/sdcard/pvr-adb-telnet.lock" # will be made, written and deleted by Server shutdownFile="/data/data/viritualisres.phonevr/files/pvr-adb-telnet.sd" # will be made by Android; Deleted by Server +shutdownFile2="pvr-adb-telnet.sd" # made by host (the one who runs this server) + lenShutdownFile=0 GREEN='\033[0;32m' NC='\033[0m' -while [ $lenShutdownFile -eq 0 ] +while [ $lenShutdownFile -eq 0 ] && [ ! -e $shutdownFile2 ] do cmd=$(adb shell "run-as viritualisres.phonevr cat $cmdFile") len=${#cmd} @@ -45,4 +47,5 @@ done echo "Shutting down Server..." adb shell "run-as viritualisres.phonevr rm -f $shutdownFile" +rm -f $shutdownFile2 echo "Server down." \ No newline at end of file From 1f89d594b16cadc8eb79c98a6f3650704d07da7e Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 01:34:55 +0530 Subject: [PATCH 008/107] Update build.yml --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1e9f2e5..ed4eb720 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -258,7 +258,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb logcat >> logcat.log - echo meow >> app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sd + echo meow >> pvr-adb-telnet.sd # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - uses: actions/upload-artifact@v3 @@ -267,6 +267,9 @@ jobs: name: screenshots path: | **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + **/app/build/reports + **/app/build/test-results + **/app/build/outputs/androidTest-results # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment From e87a5abb69da7555833cbbcff6643b79b8100fdd Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 02:44:30 +0530 Subject: [PATCH 009/107] Update build.yml --- .github/workflows/build.yml | 271 ++++++++++++++++++------------------ 1 file changed, 136 insertions(+), 135 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed4eb720..8c1613e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,143 +22,143 @@ on: # working-directory: code/mobile/android/PhoneVR jobs: - Build_PVR_Server: - name: Build PhoneVR Server - strategy: - fail-fast: false - matrix: - config: [Release, Debug] - platform: [x64, x86] - runs-on: windows-latest - - steps: - - uses: actions/checkout@v3 - - # https://github.com/actions/runner-images/issues/842#issuecomment-1495115166 - - name: Install MSVC 2015 (v140) and Windows 8.1 SDK - shell: powershell - run: | - $VS_BTOOLS_EXE="vs_buildtools.exe" - $VS_BTOOLS_URI="https://aka.ms/vs/15/release/vs_buildtools.exe" - Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE - Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList ` - "--add", "Microsoft.VisualStudio.Component.VC.140", ` - "--add", "Microsoft.VisualStudio.Component.Windows81SDK", ` - "--quiet", "--norestart", "--force", "--wait" -Wait -PassThru - - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 - - - name: Restore NuGet packages - working-directory: ${{env.GITHUB_WORKSPACE}} - run: nuget restore ${{env.SOLUTION_FILE_PATH}} - - - name: Building ${{matrix.platform}}-${{matrix.config}} - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} ${{env.SOLUTION_FILE_PATH}} - - - name: Upload Build outputs - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PROJECT_NAME }}-Server-${{ matrix.config }} - path: ${{ env.SOLUTION_DIR }}\${{ matrix.config }} + # Build_PVR_Server: + # name: Build PhoneVR Server + # strategy: + # fail-fast: false + # matrix: + # config: [Release, Debug] + # platform: [x64, x86] + # runs-on: windows-latest + + # steps: + # - uses: actions/checkout@v3 + + # # https://github.com/actions/runner-images/issues/842#issuecomment-1495115166 + # - name: Install MSVC 2015 (v140) and Windows 8.1 SDK + # shell: powershell + # run: | + # $VS_BTOOLS_EXE="vs_buildtools.exe" + # $VS_BTOOLS_URI="https://aka.ms/vs/15/release/vs_buildtools.exe" + # Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE + # Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList ` + # "--add", "Microsoft.VisualStudio.Component.VC.140", ` + # "--add", "Microsoft.VisualStudio.Component.Windows81SDK", ` + # "--quiet", "--norestart", "--force", "--wait" -Wait -PassThru + + # - name: Add MSBuild to PATH + # uses: microsoft/setup-msbuild@v1.0.2 + + # - name: Restore NuGet packages + # working-directory: ${{env.GITHUB_WORKSPACE}} + # run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + # - name: Building ${{matrix.platform}}-${{matrix.config}} + # working-directory: ${{env.GITHUB_WORKSPACE}} + # # Add additional options to the MSBuild command line here (like platform or verbosity level). + # # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + # run: msbuild /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} ${{env.SOLUTION_FILE_PATH}} + + # - name: Upload Build outputs + # uses: actions/upload-artifact@v2 + # with: + # name: ${{ env.PROJECT_NAME }}-Server-${{ matrix.config }} + # path: ${{ env.SOLUTION_DIR }}\${{ matrix.config }} - Build_APK: - name: Build Android APK - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - submodules: 'true' - - # Set Current Date As Env Variable - - name: Set current date as env variable - id: vars - shell: bash - run: | - echo "date_today=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" - echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - - name: Set Up JDK - uses: actions/setup-java@v3 - with: - distribution: 'oracle' - java-version: '17' + # Build_APK: + # name: Build Android APK + # runs-on: ubuntu-latest + + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: 'true' + + # # Set Current Date As Env Variable + # - name: Set current date as env variable + # id: vars + # shell: bash + # run: | + # echo "date_today=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" + # echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + # echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + # - name: Set Up JDK + # uses: actions/setup-java@v3 + # with: + # distribution: 'oracle' + # java-version: '17' - # Only for Testing github-actions - - uses: actions-rs/toolchain@v1 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - uses: Swatinem/rust-cache@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - cache-on-failure: true - workspaces: ${{env.GRADLE_DIR}}/ALVR/ + # # Only for Testing github-actions + # - uses: actions-rs/toolchain@v1 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # profile: minimal + # toolchain: stable + # override: true + # components: clippy + # - uses: Swatinem/rust-cache@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # cache-on-failure: true + # workspaces: ${{env.GRADLE_DIR}}/ALVR/ - - uses: gradle/gradle-build-action@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - build-root-directory: ${{env.GRADLE_DIR}} - cache-read-only: ${{ false }} - - - name: Prepare deps - run: | - ls -alh - cd code/mobile/android/PhoneVR - chmod +x prepare-alvr-deps.sh - bash prepare-alvr-deps.sh + # - uses: gradle/gradle-build-action@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # build-root-directory: ${{env.GRADLE_DIR}} + # cache-read-only: ${{ false }} + + # - name: Prepare deps + # run: | + # ls -alh + # cd code/mobile/android/PhoneVR + # chmod +x prepare-alvr-deps.sh + # bash prepare-alvr-deps.sh - - name: Change gradle wrapper permissions - run: | - cd code/mobile/android/PhoneVR - chmod +x ./gradlew - ls -alh - ls -alh app - - # Create APK Debug - - name: Build apk debug project (APK) - run: | - cd code/mobile/android/PhoneVR - ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - # Create APK Release - - name: Build apk release project (APK) - env: - Key: ${{ secrets.KEY }} - Store: ${{ secrets.STORE }} - run: | - cd code/mobile/android/PhoneVR - ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assemble --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - # Upload Artifact Build - # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/debug/ - - name: Upload APK Debug - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PROJECT_NAME }}-debug-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK - path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/debug/ - - # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/release/ - - name: Upload APK Release - uses: actions/upload-artifact@v2 - with: - name: ${{ env.PROJECT_NAME }}-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK - path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/release/ + # - name: Change gradle wrapper permissions + # run: | + # cd code/mobile/android/PhoneVR + # chmod +x ./gradlew + # ls -alh + # ls -alh app + + # # Create APK Debug + # - name: Build apk debug project (APK) + # run: | + # cd code/mobile/android/PhoneVR + # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + # # Create APK Release + # - name: Build apk release project (APK) + # env: + # Key: ${{ secrets.KEY }} + # Store: ${{ secrets.STORE }} + # run: | + # cd code/mobile/android/PhoneVR + # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assemble --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + # # Upload Artifact Build + # # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/debug/ + # - name: Upload APK Debug + # uses: actions/upload-artifact@v2 + # with: + # name: ${{ env.PROJECT_NAME }}-debug-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK + # path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/debug/ + + # # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/release/ + # - name: Upload APK Release + # uses: actions/upload-artifact@v2 + # with: + # name: ${{ env.PROJECT_NAME }}-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK + # path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/release/ - - name: Upload Build outputs on failure - if: failure() - uses: actions/upload-artifact@v2 - with: - name: build-files - path: ${{ env.GRADLE_DIR }}/app/.cxx/ + # - name: Upload Build outputs on failure + # if: failure() + # uses: actions/upload-artifact@v2 + # with: + # name: build-files + # path: ${{ env.GRADLE_DIR }}/app/.cxx/ Test_APK: name: Test APK @@ -234,9 +234,9 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: google_apis + target: playstore # google_apis force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: false script: echo "Generated AVD snapshot for caching." @@ -246,7 +246,7 @@ jobs: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: true script: | brew install telnet @@ -270,6 +270,7 @@ jobs: **/app/build/reports **/app/build/test-results **/app/build/outputs/androidTest-results + code/mobile/android/PhoneVR/ # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment From 8a3afc37b86575e42dffd1025229d1cb048b299e Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 03:03:31 +0530 Subject: [PATCH 010/107] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c1613e5..9b8da86d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -245,6 +245,7 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} + target: playstore # google_apis force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: true From 523204cabd79e815e7e8f565fe7f32ce9f04f40c Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 03:30:53 +0530 Subject: [PATCH 011/107] Update build.yml --- .github/workflows/build.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b8da86d..2af5b1f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -240,6 +240,14 @@ jobs: disable-animations: false script: echo "Generated AVD snapshot for caching." + - name: Start PVR ADB-Telnet Server + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + run: | + brew install telnet + + chmod +x pvr-adb-telnet.sh + bash pvr-adb-telnet.sh &>> log.txt & + - name: Run tests uses: reactivecircus/android-emulator-runner@v2 with: @@ -250,16 +258,15 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: true script: | - brew install telnet - - chmod +x app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh - bash app/src/androidTest/java/viritualisres/phonevr/utils/pvr-adb-telnet.sh & - adb logcat -v color & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb logcat >> logcat.log - echo meow >> pvr-adb-telnet.sd + - name: Shutdown PVR ADB-Telnet Server and log + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + run: | + echo "shutdown meow !" >> pvr-adb-telnet.sd + cat log.txt # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - uses: actions/upload-artifact@v3 From 8b2b8b32dc02952220d6675ac751d0a448a738e3 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 03:48:07 +0530 Subject: [PATCH 012/107] Update ALVRActivityTest.kt --- .../androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt index 827c75cf..ac99d56f 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt @@ -180,7 +180,6 @@ class ALVRActivityTest { // View is not in hierarchy - which is okay } - Log.d(TAG, "saveDeviceScreenBitmap: Test") rotateAVDLandscape() waitForADBTelnetServer() // Wait for ADBTelnetServer to execute rotation @@ -189,6 +188,7 @@ class ALVRActivityTest { // Wait for Rendering to settle sleep(1000) + Log.d(TAG, "saveDeviceScreenBitmap: Executed AVD Commands, Taking screenshot...") takeScreenshot() .writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}") From 7280de9f9212a63f042b5b7f1bb69dd9332884c0 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 03:57:50 +0530 Subject: [PATCH 013/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2af5b1f1..f9a10a65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: runs-on: macos-latest strategy: matrix: - api-level: [29] + api-level: [29, 33] steps: - name: checkout uses: actions/checkout@v3 From 4b1e94c5c58ab02903f311ee76c7fe78b7ff6b6f Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 04:38:02 +0530 Subject: [PATCH 014/107] Update build.yml --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9a10a65..4850d26c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: runs-on: macos-latest strategy: matrix: - api-level: [29, 33] + api-level: [/*29,*/ 33] steps: - name: checkout uses: actions/checkout@v3 @@ -246,7 +246,7 @@ jobs: brew install telnet chmod +x pvr-adb-telnet.sh - bash pvr-adb-telnet.sh &>> log.txt & + bash pvr-adb-telnet.sh >> log.txt 2>&1 & - name: Run tests uses: reactivecircus/android-emulator-runner@v2 @@ -264,6 +264,7 @@ jobs: - name: Shutdown PVR ADB-Telnet Server and log working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + if: always() run: | echo "shutdown meow !" >> pvr-adb-telnet.sd cat log.txt From 893e19a2db11a45c5817af8dae1de7786fd00ed4 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 04:47:40 +0530 Subject: [PATCH 015/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4850d26c..cb73310f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: runs-on: macos-latest strategy: matrix: - api-level: [/*29,*/ 33] + api-level: [33] # 29 steps: - name: checkout uses: actions/checkout@v3 From 4f69b42e9fe689556dcf336ee811ef84f65c9792 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 05:17:03 +0530 Subject: [PATCH 016/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb73310f..d3572037 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,7 @@ jobs: runs-on: macos-latest strategy: matrix: - api-level: [33] # 29 + api-level: [30] # 29 steps: - name: checkout uses: actions/checkout@v3 From 2632e89c1d0b8783cd88f09bc4202ca75b177251 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 06:07:58 +0530 Subject: [PATCH 017/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3572037..0e42f694 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -279,7 +279,7 @@ jobs: **/app/build/reports **/app/build/test-results **/app/build/outputs/androidTest-results - code/mobile/android/PhoneVR/ + ${{env.GRADLE_DIR}}/logcat.log # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment From 3ca8069e12a7e9c338390e21e7c78114530d0e5f Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Sun, 30 Apr 2023 06:13:37 +0530 Subject: [PATCH 018/107] Update build.yml --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e42f694..ff7cdaf0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,6 +238,8 @@ jobs: force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: false + profile: 'Pixel 2' + avd-name: 'Pixel 2' script: echo "Generated AVD snapshot for caching." - name: Start PVR ADB-Telnet Server @@ -257,6 +259,8 @@ jobs: force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: true + profile: 'Pixel 2' + avd-name: 'Pixel 2' script: | adb logcat -v color & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} From 3da576581cf85392a6cc5df07ddf4e5c1849d385 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 00:29:35 +0530 Subject: [PATCH 019/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff7cdaf0..1406af81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,7 +238,7 @@ jobs: force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: false - profile: 'Pixel 2' + profile: pixel_2 avd-name: 'Pixel 2' script: echo "Generated AVD snapshot for caching." @@ -259,7 +259,7 @@ jobs: force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: true - profile: 'Pixel 2' + profile: pixel_2 avd-name: 'Pixel 2' script: | adb logcat -v color & From 8352c96603fe5d49f11f8bda7a9c79c7c79ba41c Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 00:52:49 +0530 Subject: [PATCH 020/107] Update build.yml --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1406af81..9b5295cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -222,12 +222,6 @@ jobs: ~/.android/adb* key: avd-${{ matrix.api-level }} - # Cache APK gradle tasks - - name: Build apk debug project (APK) - run: | - cd code/mobile/android/PhoneVR - ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - name: create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 @@ -239,8 +233,14 @@ jobs: emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: false profile: pixel_2 - avd-name: 'Pixel 2' + avd-name: Pixel_2 script: echo "Generated AVD snapshot for caching." + + # Cache APK gradle tasks + - name: Build apk debug project (APK) + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - name: Start PVR ADB-Telnet Server working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ From e71fd1a9809de179a657da53d4c78b3d929ce110 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 00:54:45 +0530 Subject: [PATCH 021/107] Update build.yml --- .github/workflows/build.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b5295cd..725d42a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,6 +198,20 @@ jobs: build-root-directory: ${{env.GRADLE_DIR}} cache-read-only: ${{ false }} + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: playstore # google_apis + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none + disable-animations: false + profile: pixel_2 + avd-name: Pixel_2 + script: echo "Generated AVD snapshot for caching." + - name: Prepare deps shell: bash run: | @@ -222,19 +236,6 @@ jobs: ~/.android/adb* key: avd-${{ matrix.api-level }} - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: playstore # google_apis - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none - disable-animations: false - profile: pixel_2 - avd-name: Pixel_2 - script: echo "Generated AVD snapshot for caching." # Cache APK gradle tasks - name: Build apk debug project (APK) From 123913f427ff8be9f00762dff4e9b932987299e0 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 01:15:06 +0530 Subject: [PATCH 022/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 725d42a9..1b0bc4bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -261,7 +261,7 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none disable-animations: true profile: pixel_2 - avd-name: 'Pixel 2' + avd-name: Pixel_2 script: | adb logcat -v color & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} From e3155a4bb7cba0f147f77c5315fffcb57d21ce50 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 02:05:57 +0530 Subject: [PATCH 023/107] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b0bc4bd..71dcd102 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,9 +263,9 @@ jobs: profile: pixel_2 avd-name: Pixel_2 script: | - adb logcat -v color & + adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb logcat >> logcat.log + adb shell "logcat" >> logcat.log - name: Shutdown PVR ADB-Telnet Server and log working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ @@ -334,7 +334,7 @@ jobs: echo "" >> comment.md # for each .png in that AVD folder - for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd/"*.png; do + for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do ss_test_desc=$(basename "$ss_test" .png) From fcfb67e2e9770a34f22cbd8788374d453ae34d53 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 02:13:18 +0530 Subject: [PATCH 024/107] Update build.yml --- .github/workflows/build.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71dcd102..626ebbcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,6 +198,15 @@ jobs: build-root-directory: ${{env.GRADLE_DIR}} cache-read-only: ${{ false }} + - name: AVD cache + uses: actions/cache@v3 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} + - name: create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 @@ -226,16 +235,6 @@ jobs: chmod +x ./gradlew ls -alh ls -alh app - - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.api-level }} - # Cache APK gradle tasks - name: Build apk debug project (APK) @@ -368,3 +367,12 @@ jobs: body-file: comment.md edit-mode: replace issue-number: ${{ github.event.number }} + + - name: Save AVD Cache + uses: actions/cache/save@v3 + if: always() && !steps.avd-cache.outputs.cache-hit + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: ${{ steps.avd-cache.outputs.cache-primary-key }} From 16bac7c9f303ad1167f6e2c1690ca851a9f1bdf0 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 02:29:16 +0530 Subject: [PATCH 025/107] fix: CI ANR --- .../viritualisres/phonevr/ALVRActivityTest.kt | 24 +++++++++++++++---- .../viritualisres/phonevr/AppPackageTest.kt | 17 +++++++++++++ .../viritualisres/phonevr/InitActivityTest.kt | 17 +++++++++++++ .../viritualisres/phonevr/MainActivityTest.kt | 18 +++++++++++++- .../phonevr/SettingsActivityTest.kt | 17 +++++++++++++ 5 files changed, 88 insertions(+), 5 deletions(-) diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt index ac99d56f..c72c1d6d 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt @@ -1,7 +1,6 @@ package viritualisres.phonevr import android.annotation.SuppressLint -import android.os.Environment.DIRECTORY_DOWNLOADS import android.util.Log import androidx.test.core.app.takeScreenshot import androidx.test.core.graphics.writeToTestStorage @@ -13,7 +12,12 @@ import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.rules.activityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import androidx.test.rule.GrantPermissionRule +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiObjectNotFoundException +import androidx.test.uiautomator.UiSelector +import org.junit.BeforeClass import org.junit.Rule import org.junit.Test import org.junit.rules.TestName @@ -166,9 +170,21 @@ class ALVRActivityTest { // set gravity acceleration g in Y Direction - real Mock sendADBCommand("sensor set acceleration 9.77622:0:0"); } - /** - * Captures and saves an image of the entire device screen to storage. - */ + + companion object { + // This is a specific fix for CIs (github-actions, etc) to close ANR dialog + @JvmStatic + @BeforeClass + fun dismissANRSystemDialog() { + val device = UiDevice.getInstance(getInstrumentation()) + // If running the device in English Locale + val waitButton = device.findObject(UiSelector().textContains("wait")) + if (waitButton.exists()) { + waitButton.click() + } + } + } + @SuppressLint("CheckResult") @Test @Throws(IOException::class) diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt index 57b3956b..1109610b 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt @@ -2,14 +2,31 @@ package viritualisres.phonevr import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector import org.junit.Test import org.junit.runner.RunWith import org.junit.Assert.* +import org.junit.BeforeClass @RunWith(AndroidJUnit4::class) class AppPackageTest { + + companion object { + // This is a specific fix for CIs (github-actions, etc) to close ANR dialog + @JvmStatic + @BeforeClass + fun dismissANRSystemDialog() { + val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + // If running the device in English Locale + val waitButton = device.findObject(UiSelector().textContains("wait")) + if (waitButton.exists()) { + waitButton.click() + } + } + } @Test fun useAppContext() { // Context of the app under test. diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt index 520bd1a1..89c9462a 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt @@ -9,6 +9,10 @@ import androidx.test.espresso.matcher.ViewMatchers import androidx.test.espresso.matcher.ViewMatchers.isRoot import androidx.test.ext.junit.rules.activityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import org.junit.BeforeClass import org.junit.Rule import org.junit.Test import org.junit.rules.TestName @@ -27,6 +31,19 @@ import java.lang.Thread.sleep */ @RunWith(AndroidJUnit4::class) class InitActivityTest { + companion object { + // This is a specific fix for CIs (github-actions, etc) to close ANR dialog + @JvmStatic + @BeforeClass + fun dismissANRSystemDialog() { + val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + // If running the device in English Locale + val waitButton = device.findObject(UiSelector().textContains("wait")) + if (waitButton.exists()) { + waitButton.click() + } + } + } // a handy JUnit rule that stores the method name, so it can be used to generate unique // screenshot files per test method @get:Rule diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt index 8797ffe7..57889bad 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt @@ -7,7 +7,11 @@ import androidx.test.espresso.Espresso.onView import androidx.test.espresso.matcher.ViewMatchers.isRoot import androidx.test.ext.junit.rules.activityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry import androidx.test.rule.GrantPermissionRule +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import org.junit.BeforeClass import org.junit.Rule import org.junit.Test import org.junit.rules.TestName @@ -27,7 +31,19 @@ import java.lang.Thread.sleep */ @RunWith(AndroidJUnit4::class) class MainActivityTest { - + companion object { + // This is a specific fix for CIs (github-actions, etc) to close ANR dialog + @JvmStatic + @BeforeClass + fun dismissANRSystemDialog() { + val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + // If running the device in English Locale + val waitButton = device.findObject(UiSelector().textContains("wait")) + if (waitButton.exists()) { + waitButton.click() + } + } + } @get:Rule var perms1:GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE); diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt index 539c3411..82ebdfb4 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt @@ -7,6 +7,10 @@ import androidx.test.espresso.Espresso.onView import androidx.test.espresso.matcher.ViewMatchers.isRoot import androidx.test.ext.junit.rules.activityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import org.junit.BeforeClass import org.junit.Rule import org.junit.Test import org.junit.rules.TestName @@ -26,6 +30,19 @@ import java.lang.Thread.sleep */ @RunWith(AndroidJUnit4::class) class SettingsActivityTest { + companion object { + // This is a specific fix for CIs (github-actions, etc) to close ANR dialog + @JvmStatic + @BeforeClass + fun dismissANRSystemDialog() { + val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + // If running the device in English Locale + val waitButton = device.findObject(UiSelector().textContains("wait")) + if (waitButton.exists()) { + waitButton.click() + } + } + } // a handy JUnit rule that stores the method name, so it can be used to generate unique // screenshot files per test method @get:Rule From 727cf1634156fe2658c86ca72a2f07208ba83898 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 02:41:54 +0530 Subject: [PATCH 026/107] Update build.yml --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 626ebbcd..77f1fbeb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -317,6 +317,7 @@ jobs: REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} EVENT: ${{ github.event_name }} REF: ${{ github.ref }} + WK_DIR: ${{env.GRADLE_DIR}} shell: bash working-directory: ${{env.GRADLE_DIR}} run: | @@ -340,8 +341,9 @@ jobs: echo "#### 🔧 $ss_test_desc" >> comment.md echo '

' >> comment.md - cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md + cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md echo '

' >> comment.md + echo "$WK_DIR/$ss_test" done done From e2af9190afc7332e7399b240818c6c7cab5e34db Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 02:59:26 +0530 Subject: [PATCH 027/107] refac to class --- .../viritualisres/phonevr/ALVRActivityTest.kt | 37 +-------- .../viritualisres/phonevr/AppPackageTest.kt | 17 +--- .../viritualisres/phonevr/InitActivityTest.kt | 16 +--- .../viritualisres/phonevr/MainActivityTest.kt | 41 +--------- .../phonevr/SettingsActivityTest.kt | 16 +--- .../phonevr/utils/PVRInstrumentationBase.kt | 82 +++++++++++++++++++ 6 files changed, 93 insertions(+), 116 deletions(-) create mode 100644 code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/PVRInstrumentationBase.kt diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt index c72c1d6d..17bfe727 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt @@ -22,6 +22,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestName import org.junit.runner.RunWith +import viritualisres.phonevr.utils.PVRInstrumentationBase import java.io.File import java.io.FileOutputStream import java.io.IOException @@ -38,7 +39,7 @@ import java.lang.Thread.sleep * build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2_API_30(AVD) - 11 */ @RunWith(AndroidJUnit4::class) -class ALVRActivityTest { +class ALVRActivityTest: PVRInstrumentationBase() { private val TAG: String? = javaClass.simpleName @@ -50,26 +51,6 @@ class ALVRActivityTest { @get:Rule var perms7: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.CAMERA); - /*@get:Rule - var perms3: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.VIBRATE); - - @get:Rule - var perms1:GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE); - - @get:Rule - var perms4: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.NFC); - - @get:Rule - var perms5: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.INTERNET); - - @get:Rule - var perms6: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_LOGS); - - @get:Rule - var perms9: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.WAKE_LOCK); - - @get:Rule - var perms10: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_WIFI_STATE);*/ @get:Rule var nameRule = TestName() @@ -171,20 +152,6 @@ class ALVRActivityTest { sendADBCommand("sensor set acceleration 9.77622:0:0"); } - companion object { - // This is a specific fix for CIs (github-actions, etc) to close ANR dialog - @JvmStatic - @BeforeClass - fun dismissANRSystemDialog() { - val device = UiDevice.getInstance(getInstrumentation()) - // If running the device in English Locale - val waitButton = device.findObject(UiSelector().textContains("wait")) - if (waitButton.exists()) { - waitButton.click() - } - } - } - @SuppressLint("CheckResult") @Test @Throws(IOException::class) diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt index 1109610b..98e1610f 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/AppPackageTest.kt @@ -10,23 +10,10 @@ import org.junit.runner.RunWith import org.junit.Assert.* import org.junit.BeforeClass +import viritualisres.phonevr.utils.PVRInstrumentationBase @RunWith(AndroidJUnit4::class) -class AppPackageTest { - - companion object { - // This is a specific fix for CIs (github-actions, etc) to close ANR dialog - @JvmStatic - @BeforeClass - fun dismissANRSystemDialog() { - val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) - // If running the device in English Locale - val waitButton = device.findObject(UiSelector().textContains("wait")) - if (waitButton.exists()) { - waitButton.click() - } - } - } +class AppPackageTest: PVRInstrumentationBase() { @Test fun useAppContext() { // Context of the app under test. diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt index 89c9462a..bdd78e5e 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/InitActivityTest.kt @@ -17,6 +17,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestName import org.junit.runner.RunWith +import viritualisres.phonevr.utils.PVRInstrumentationBase import java.io.IOException import java.lang.Thread.sleep @@ -30,20 +31,7 @@ import java.lang.Thread.sleep * build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2_API_30(AVD) - 11 */ @RunWith(AndroidJUnit4::class) -class InitActivityTest { - companion object { - // This is a specific fix for CIs (github-actions, etc) to close ANR dialog - @JvmStatic - @BeforeClass - fun dismissANRSystemDialog() { - val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) - // If running the device in English Locale - val waitButton = device.findObject(UiSelector().textContains("wait")) - if (waitButton.exists()) { - waitButton.click() - } - } - } +class InitActivityTest: PVRInstrumentationBase() { // a handy JUnit rule that stores the method name, so it can be used to generate unique // screenshot files per test method @get:Rule diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt index 57889bad..c5106875 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/MainActivityTest.kt @@ -16,6 +16,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestName import org.junit.runner.RunWith +import viritualisres.phonevr.utils.PVRInstrumentationBase import java.io.IOException import java.lang.Thread.sleep @@ -30,50 +31,14 @@ import java.lang.Thread.sleep * build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2_API_30(AVD) - 11 */ @RunWith(AndroidJUnit4::class) -class MainActivityTest { - companion object { - // This is a specific fix for CIs (github-actions, etc) to close ANR dialog - @JvmStatic - @BeforeClass - fun dismissANRSystemDialog() { - val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) - // If running the device in English Locale - val waitButton = device.findObject(UiSelector().textContains("wait")) - if (waitButton.exists()) { - waitButton.click() - } - } - } +class MainActivityTest: PVRInstrumentationBase() { + @get:Rule var perms1:GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE); @get:Rule var perms2:GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE); - /*@get:Rule - var perms3: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.VIBRATE); - - @get:Rule - var perms4: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.NFC); - - @get:Rule - var perms5: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.INTERNET); - - @get:Rule - var perms6: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_LOGS); - - @get:Rule - var perms7: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.CAMERA); - - @get:Rule - var perms8: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.RECORD_AUDIO); - - @get:Rule - var perms9: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.WAKE_LOCK); - - @get:Rule - var perms10: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_WIFI_STATE);*/ - @get:Rule var nameRule = TestName() diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt index 82ebdfb4..cea60f11 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/SettingsActivityTest.kt @@ -15,6 +15,7 @@ import org.junit.Rule import org.junit.Test import org.junit.rules.TestName import org.junit.runner.RunWith +import viritualisres.phonevr.utils.PVRInstrumentationBase import java.io.IOException import java.lang.Thread.sleep @@ -29,20 +30,7 @@ import java.lang.Thread.sleep * build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2_API_30(AVD) - 11 */ @RunWith(AndroidJUnit4::class) -class SettingsActivityTest { - companion object { - // This is a specific fix for CIs (github-actions, etc) to close ANR dialog - @JvmStatic - @BeforeClass - fun dismissANRSystemDialog() { - val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) - // If running the device in English Locale - val waitButton = device.findObject(UiSelector().textContains("wait")) - if (waitButton.exists()) { - waitButton.click() - } - } - } +class SettingsActivityTest: PVRInstrumentationBase() { // a handy JUnit rule that stores the method name, so it can be used to generate unique // screenshot files per test method @get:Rule diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/PVRInstrumentationBase.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/PVRInstrumentationBase.kt new file mode 100644 index 00000000..aadd1cf4 --- /dev/null +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/utils/PVRInstrumentationBase.kt @@ -0,0 +1,82 @@ +package viritualisres.phonevr.utils + +import android.util.Log +import androidx.test.espresso.Espresso +import androidx.test.espresso.base.DefaultFailureHandler +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.rule.GrantPermissionRule +import androidx.test.uiautomator.UiDevice +import androidx.test.uiautomator.UiSelector +import org.junit.Before +import org.junit.BeforeClass +import org.junit.Rule +import java.util.Locale + +open class PVRInstrumentationBase { + //Running count of the number of Android Not Responding dialogues to prevent endless dismissal. + private var anrCount = 0 + //`RootViewWithoutFocusException` class is private, need to match the message (instead of using type matching). + private val rootViewWithoutFocusExceptionMsg = java.lang.String.format( + Locale.ROOT, + "Waited for the root of the view hierarchy to have " + + "window focus and not request layout for 10 seconds. If you specified a non " + + "default root matcher, it may be picking a root that never takes focus. " + + "Root:") + + /*@get:Rule + var perms2: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.WRITE_EXTERNAL_STORAGE); + + @get:Rule + var perms8: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.RECORD_AUDIO); + + @get:Rule + var perms7: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.CAMERA); + @get:Rule + var perms3: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.VIBRATE); + + @get:Rule + var perms1:GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE); + + @get:Rule + var perms4: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.NFC); + + @get:Rule + var perms5: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.INTERNET); + + @get:Rule + var perms6: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_LOGS); + + @get:Rule + var perms9: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.WAKE_LOCK); + + @get:Rule + var perms10: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_WIFI_STATE);*/ + + @Before + fun setUpHandler() { + Espresso.setFailureHandler { error, viewMatcher -> + + if (error.message!!.contains(rootViewWithoutFocusExceptionMsg) && anrCount < 3) { + anrCount++ + dismissANRSystemDialog() + } else { // chain all failures down to the default espresso handler + DefaultFailureHandler(InstrumentationRegistry.getInstrumentation().targetContext).handle(error, viewMatcher) + } + } + } + + companion object { + // This is a specific fix for CIs (github-actions, etc) to close ANR dialog + @JvmStatic + @BeforeClass + fun dismissANRSystemDialog() { + Log.d("PVR-Test-Debug", "dismissANRSystemDialog: Called") + val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + // If running the device in English Locale + val waitButton = device.findObject(UiSelector().textContains("wait")) + if (waitButton.exists()) { + waitButton.click() + } + } + } +} \ No newline at end of file From bdfd43db2277d63f0515b979ac3803eeefc8e286 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 03:08:24 +0530 Subject: [PATCH 028/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77f1fbeb..beef2bc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -377,4 +377,4 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: ${{ steps.avd-cache.outputs.cache-primary-key }} + key: avd-${{ matrix.api-level }} From 375d93986dda7e6997d4d7873fab9185182e7948 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 08:56:58 +0530 Subject: [PATCH 029/107] Update build.yml --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index beef2bc2..ee8a3a2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -277,7 +277,7 @@ jobs: - uses: actions/upload-artifact@v3 if: always() with: - name: screenshots + name: Test results path: | **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* **/app/build/reports @@ -324,6 +324,9 @@ jobs: echo "# 📷 Screenshots of tests:" >> comment.md echo "" >> comment.md + ls -alh + ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do From 4421244582dd2066ca1fdd94e4a53db1ae13f989 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 09:23:24 +0530 Subject: [PATCH 030/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee8a3a2b..faef448d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -215,7 +215,7 @@ jobs: api-level: ${{ matrix.api-level }} target: playstore # google_apis force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none + emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose # -noaudio -camera-back none disable-animations: false profile: pixel_2 avd-name: Pixel_2 @@ -257,7 +257,7 @@ jobs: api-level: ${{ matrix.api-level }} target: playstore # google_apis force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim # -noaudio -camera-back none + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim -verbose # -noaudio -camera-back none disable-animations: true profile: pixel_2 avd-name: Pixel_2 From 0d1fe46342bb0f44945e9bce2474277fe1ec0727 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 09:33:49 +0530 Subject: [PATCH 031/107] Update build.yml --- .github/workflows/build.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index faef448d..070390bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,14 +198,14 @@ jobs: build-root-directory: ${{env.GRADLE_DIR}} cache-read-only: ${{ false }} - - name: AVD cache - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.api-level }} + # - name: AVD cache + # uses: actions/cache@v3 + # id: avd-cache + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} - name: create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' @@ -373,11 +373,11 @@ jobs: edit-mode: replace issue-number: ${{ github.event.number }} - - name: Save AVD Cache - uses: actions/cache/save@v3 - if: always() && !steps.avd-cache.outputs.cache-hit - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.api-level }} + # - name: Save AVD Cache + # uses: actions/cache/save@v3 + # if: always() && !steps.avd-cache.outputs.cache-hit + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} From 9c2cf47309e1e2095ec680ba6ce1c37d85fd2095 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 09:41:44 +0530 Subject: [PATCH 032/107] Update build.yml --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 070390bf..bea46d2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -326,6 +326,7 @@ jobs: ls -alh ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + ls -alh "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11" # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do @@ -343,10 +344,10 @@ jobs: echo "#### 🔧 $ss_test_desc" >> comment.md + echo "$WK_DIR/$ss_test" echo '

' >> comment.md cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md echo '

' >> comment.md - echo "$WK_DIR/$ss_test" done done From da078c393fe1a255e5807a22d9e39fd061b61683 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 10:23:46 +0530 Subject: [PATCH 033/107] Update build.yml --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bea46d2f..46765a04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -326,11 +326,12 @@ jobs: ls -alh ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - ls -alh "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11" # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + ls -alh "$ss_test_avd" + echo "$ss_test_avd" ss_test_avd_desc=$(basename "$ss_test_avd") echo "" >> comment.md From 4dcf16585958e977e74671d60340f1f6144e493a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 11:28:05 +0530 Subject: [PATCH 034/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46765a04..d0bae04f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -215,7 +215,7 @@ jobs: api-level: ${{ matrix.api-level }} target: playstore # google_apis force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose # -noaudio -camera-back none + emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio disable-animations: false profile: pixel_2 avd-name: Pixel_2 @@ -257,7 +257,7 @@ jobs: api-level: ${{ matrix.api-level }} target: playstore # google_apis force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim -verbose # -noaudio -camera-back none + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio disable-animations: true profile: pixel_2 avd-name: Pixel_2 From ebc44ff3b90b6785420a6a31dfa0259af28b8698 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 11:43:27 +0530 Subject: [PATCH 035/107] Update build.yml --- .github/workflows/build.yml | 100 +++++++++++++++++++++++++++++++++--- 1 file changed, 92 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0bae04f..4e3fbe0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -163,6 +163,12 @@ jobs: Test_APK: name: Test APK runs-on: macos-latest + env: + EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + EMU_PROFILE: pixel_2 + EMU_AVD_NAME: Pixel_2 + EMU_TARGET: playstore # google_apis + strategy: matrix: api-level: [30] # 29 @@ -207,20 +213,56 @@ jobs: # ~/.android/adb* # key: avd-${{ matrix.api-level }} + ## Create AVD with some redundancy - 3 Checks - name: create AVD and generate snapshot for caching if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_1 + continue-on-error: true with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: playstore # google_apis + target: $${{ env.EMU_TARGET }} force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + emulator-options: ${{ env.EMU_OPTS }} disable-animations: false - profile: pixel_2 - avd-name: Pixel_2 + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.AVD_NAME }} script: echo "Generated AVD snapshot for caching." + - name: create AVD and generate snapshot for caching try#2 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: $${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + + - name: create AVD and generate snapshot for caching try#3 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_3 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: $${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + ## Redundancy End + - name: Prepare deps shell: bash run: | @@ -250,21 +292,63 @@ jobs: chmod +x pvr-adb-telnet.sh bash pvr-adb-telnet.sh >> log.txt 2>&1 & + ## Create AVD with some redundancy - 3 Checks - name: Run tests + uses: reactivecircus/android-emulator-runner@v2 + id: avd_run_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: $${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat" >> logcat.log + + - name: Run tests try#2 uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_1.outcome == 'failure' + id: avd_run_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: $${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat" >> logcat.log + + - name: Run tests try#3 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_2.outcome == 'failure' + id: avd_run_3 + continue-on-error: true with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: playstore # google_apis + target: $${{ env.EMU_TARGET }} force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + emulator-options: ${{ env.EMU_OPTS }} disable-animations: true - profile: pixel_2 - avd-name: Pixel_2 + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.AVD_NAME }} script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat" >> logcat.log + ## Redundancy End - name: Shutdown PVR ADB-Telnet Server and log working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ From 91c3fa4ad9c1424366892fd22e3b80813c01a8f7 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 12:04:01 +0530 Subject: [PATCH 036/107] Update build.gradle --- code/mobile/android/PhoneVR/app/build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/mobile/android/PhoneVR/app/build.gradle b/code/mobile/android/PhoneVR/app/build.gradle index 449262a8..92ffe246 100644 --- a/code/mobile/android/PhoneVR/app/build.gradle +++ b/code/mobile/android/PhoneVR/app/build.gradle @@ -89,6 +89,17 @@ android { path "CMakeLists.txt" } } + project.gradle.taskGraph.whenReady { + android.productFlavors.all { flavor -> + // Capitalize (as Gralde is case-sensitive). + def flavorName = flavor.name.substring(0, 1).toUpperCase() + flavor.name.substring(1) + + // At last, configure. + "connected${flavorName}DebugAndroidTest" { + ignoreFailures = true + } + } + } // CompileOptions required for ARCA compileOptions { From d9b3f14e1618060b211e83f78cafaa0747b1315e Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 12:25:09 +0530 Subject: [PATCH 037/107] Update build.yml --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e3fbe0a..a27da3ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -292,6 +292,13 @@ jobs: chmod +x pvr-adb-telnet.sh bash pvr-adb-telnet.sh >> log.txt 2>&1 & + - name: Install recorder and record session + env: + SUFFIX: ${{ api-level }} + run: | + brew install ffmpeg + ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + ## Create AVD with some redundancy - 3 Checks - name: Run tests uses: reactivecircus/android-emulator-runner@v2 @@ -368,6 +375,7 @@ jobs: **/app/build/test-results **/app/build/outputs/androidTest-results ${{env.GRADLE_DIR}}/logcat.log + ./*.mov # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment From c7954bcfc245724b1d0e67741144b24175591c05 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 12:25:47 +0530 Subject: [PATCH 038/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a27da3ce..221dfe3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -294,7 +294,7 @@ jobs: - name: Install recorder and record session env: - SUFFIX: ${{ api-level }} + SUFFIX: ${{ matrix.api-level }} run: | brew install ffmpeg ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & From 33221600e998a3a44f673f5a9230e97644eeac67 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 12:28:23 +0530 Subject: [PATCH 039/107] Update build.yml --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 221dfe3a..cf1bc62e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -222,7 +222,7 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: $${{ env.EMU_TARGET }} + target: ${{ env.EMU_TARGET }} force-avd-creation: false emulator-options: ${{ env.EMU_OPTS }} disable-animations: false @@ -238,7 +238,7 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: $${{ env.EMU_TARGET }} + target: ${{ env.EMU_TARGET }} force-avd-creation: false emulator-options: ${{ env.EMU_OPTS }} disable-animations: false @@ -250,11 +250,11 @@ jobs: if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' uses: reactivecircus/android-emulator-runner@v2 id: avd_create_3 - continue-on-error: true + # continue-on-error: true # Fail if even fail the 3rd try with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: $${{ env.EMU_TARGET }} + target: ${{ env.EMU_TARGET }} force-avd-creation: false emulator-options: ${{ env.EMU_OPTS }} disable-animations: false @@ -307,7 +307,7 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: $${{ env.EMU_TARGET }} + target: ${{ env.EMU_TARGET }} force-avd-creation: false emulator-options: ${{ env.EMU_OPTS }} disable-animations: true @@ -326,7 +326,7 @@ jobs: with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: $${{ env.EMU_TARGET }} + target: ${{ env.EMU_TARGET }} force-avd-creation: false emulator-options: ${{ env.EMU_OPTS }} disable-animations: true @@ -341,11 +341,11 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 if: steps.avd_run_2.outcome == 'failure' id: avd_run_3 - continue-on-error: true + # continue-on-error: true # Fail if even fail the 3rd try with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} - target: $${{ env.EMU_TARGET }} + target: ${{ env.EMU_TARGET }} force-avd-creation: false emulator-options: ${{ env.EMU_OPTS }} disable-animations: true From f349ca1f38c098e1c91f82391d2b7d7d831a0065 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 12:43:17 +0530 Subject: [PATCH 040/107] Update build.yml --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf1bc62e..57ccf76e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -227,7 +227,7 @@ jobs: emulator-options: ${{ env.EMU_OPTS }} disable-animations: false profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.AVD_NAME }} + avd-name: ${{ env.EMU_AVD_NAME }} script: echo "Generated AVD snapshot for caching." - name: create AVD and generate snapshot for caching try#2 @@ -243,7 +243,7 @@ jobs: emulator-options: ${{ env.EMU_OPTS }} disable-animations: false profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.AVD_NAME }} + avd-name: ${{ env.EMU_AVD_NAME }} script: echo "Generated AVD snapshot for caching." - name: create AVD and generate snapshot for caching try#3 @@ -259,7 +259,7 @@ jobs: emulator-options: ${{ env.EMU_OPTS }} disable-animations: false profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.AVD_NAME }} + avd-name: ${{ env.EMU_AVD_NAME }} script: echo "Generated AVD snapshot for caching." ## Redundancy End @@ -312,7 +312,7 @@ jobs: emulator-options: ${{ env.EMU_OPTS }} disable-animations: true profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.AVD_NAME }} + avd-name: ${{ env.EMU_AVD_NAME }} script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} @@ -331,7 +331,7 @@ jobs: emulator-options: ${{ env.EMU_OPTS }} disable-animations: true profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.AVD_NAME }} + avd-name: ${{ env.EMU_AVD_NAME }} script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} @@ -350,7 +350,7 @@ jobs: emulator-options: ${{ env.EMU_OPTS }} disable-animations: true profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.AVD_NAME }} + avd-name: ${{ env.EMU_AVD_NAME }} script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} From a80ac41bee5f7f8a704c96a1fb0a46c3997eb75d Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 12:48:01 +0530 Subject: [PATCH 041/107] Update build.yml --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57ccf76e..d13a1502 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -273,6 +273,8 @@ jobs: - name: Change gradle wrapper permissions run: | + echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support + cd code/mobile/android/PhoneVR chmod +x ./gradlew ls -alh From c2ed291c2ec18d170bb8ff12f96405e0b88d6e6f Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 13:10:25 +0530 Subject: [PATCH 042/107] Update build.yml --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d13a1502..418d1067 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -273,7 +273,7 @@ jobs: - name: Change gradle wrapper permissions run: | - echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support + echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs cd code/mobile/android/PhoneVR chmod +x ./gradlew @@ -318,7 +318,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat" >> logcat.log + adb shell "logcat -b all" >> logcat.log - name: Run tests try#2 uses: reactivecircus/android-emulator-runner@v2 @@ -337,7 +337,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat" >> logcat.log + adb shell "logcat -b all" >> logcat.log - name: Run tests try#3 uses: reactivecircus/android-emulator-runner@v2 @@ -356,9 +356,13 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat" >> logcat.log + adb shell "logcat -b all" >> logcat.log ## Redundancy End + - name: Get Bug Report & tombstones + run: | + adb bugreport bugreport.zip + - name: Shutdown PVR ADB-Telnet Server and log working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ if: always() @@ -378,6 +382,7 @@ jobs: **/app/build/outputs/androidTest-results ${{env.GRADLE_DIR}}/logcat.log ./*.mov + bugreport.zip # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment From 0b599f5142662380ce2eb02ba0095fb2846f358b Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 13:38:18 +0530 Subject: [PATCH 043/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 418d1067..ddc677ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -299,7 +299,7 @@ jobs: SUFFIX: ${{ matrix.api-level }} run: | brew install ffmpeg - ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & ## Create AVD with some redundancy - 3 Checks - name: Run tests From fbe383b66dc5ab1fe4cdbe8a7e9c94d905fe0c94 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 13:51:50 +0530 Subject: [PATCH 044/107] Update AndroidManifest.xml --- code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml b/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml index 61d68bf1..5b24bad7 100644 --- a/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml +++ b/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml @@ -30,6 +30,9 @@ + Date: Mon, 1 May 2023 13:54:54 +0530 Subject: [PATCH 045/107] upd --- .github/workflows/build.yml | 1 + code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddc677ec..bff9ca32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -360,6 +360,7 @@ jobs: ## Redundancy End - name: Get Bug Report & tombstones + if: always() run: | adb bugreport bugreport.zip diff --git a/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml b/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml index 5b24bad7..a0e97b0d 100644 --- a/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml +++ b/code/mobile/android/PhoneVR/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ Date: Mon, 1 May 2023 14:07:11 +0530 Subject: [PATCH 046/107] Update build.yml --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bff9ca32..90ab4eaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -298,6 +298,12 @@ jobs: env: SUFFIX: ${{ matrix.api-level }} run: | + brew install glfw3 + brew install glew + brew install glxinfo + + glxinfo | grep -i opengl + brew install ffmpeg ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & From dfec2099ce0f5cc5954894c883baaa9dfd0bd31a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 23:47:27 +0530 Subject: [PATCH 047/107] Update build.yml --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90ab4eaf..b6d6fcce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -274,7 +274,8 @@ jobs: - name: Change gradle wrapper permissions run: | echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs - + cat ~/.android/advancedFeatures.ini + cd code/mobile/android/PhoneVR chmod +x ./gradlew ls -alh @@ -302,8 +303,8 @@ jobs: brew install glew brew install glxinfo - glxinfo | grep -i opengl - + # glxinfo | grep -i opengl + brew install ffmpeg ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & From 886b2175e0ede9c2c1c79308b1d2e9db8dd13245 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 1 May 2023 23:48:49 +0530 Subject: [PATCH 048/107] Update build.yml --- .github/workflows/build.yml | 330 ++++++++++++++++++++++++++++++++++++ 1 file changed, 330 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6d6fcce..53acbfc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,6 +263,336 @@ jobs: script: echo "Generated AVD snapshot for caching." ## Redundancy End + - name: Prepare deps + shell: bash + run: | + ls -alh + cd code/mobile/android/PhoneVR + chmod +x prepare-alvr-deps.sh + bash prepare-alvr-deps.sh + + - name: Change gradle wrapper permissions + run: | + echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs + cat ~/.android/advancedFeatures.ini + + cd code/mobile/android/PhoneVR + chmod +x ./gradlew + ls -alh + ls -alh app + + # Cache APK gradle tasks + - name: Build apk debug project (APK) + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + - name: Start PVR ADB-Telnet Server + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + run: | + brew install telnet + + chmod +x pvr-adb-telnet.sh + bash pvr-adb-telnet.sh >> log.txt 2>&1 & + + - name: Install recorder and record session + env: + SUFFIX: ${{ matrix.api-level }} + run: | + brew install glfw3 + brew install glew + brew install glxinfo + + # glxinfo | grep -i opengl + + brew install ffmpeg + ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + + ## Create AVD with some redundancy - 3 Checks + - name: Run tests + uses: reactivecircus/android-emulator-runner@v2 + id: avd_run_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + + - name: Run tests try#2 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_1.outcome == 'failure' + id: avd_run_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + + - name: Run tests try#3 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_2.outcome == 'failure' + id: avd_run_3 + # continue-on-error: true # Fail if even fail the 3rd try + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + ## Redundancy End + + - name: Get Bug Report & tombstones + if: always() + run: | + adb bugreport bugreport.zip + + - name: Shutdown PVR ADB-Telnet Server and log + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + if: always() + run: | + echo "shutdown meow !" >> pvr-adb-telnet.sd + cat log.txt + + # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + - uses: actions/upload-artifact@v3 + if: always() + with: + name: Test results + path: | + **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + **/app/build/reports + **/app/build/test-results + **/app/build/outputs/androidTest-results + ${{env.GRADLE_DIR}}/logcat.log + ./*.mov + bugreport.zip + + # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml + - name: Publish Test Results in Comment + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + if: always() + with: + report_individual_runs: true + report_suite_logs: 'any' + deduplicate_classes_by_file_name: true + comment_title: '🛠 Test Results' + files: | + code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + + - uses: iterative/setup-cml@v1 + if: always() + + - name: Publish Screenshots - Find Comment + if: always() + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.number }} + body-includes: '# 📷 Screenshots of tests:' + direction: last + comment-author: 'github-actions[bot]' + + - name: Publish Screenshots - build comment + if: always() + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EVENT: ${{ github.event_name }} + REF: ${{ github.ref }} + WK_DIR: ${{env.GRADLE_DIR}} + shell: bash + working-directory: ${{env.GRADLE_DIR}} + run: | + echo "# 📷 Screenshots of tests:" >> comment.md + echo "" >> comment.md + + ls -alh + ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + + # for each AVD Image + for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + + ls -alh "$ss_test_avd" + echo "$ss_test_avd" + ss_test_avd_desc=$(basename "$ss_test_avd") + + echo "" >> comment.md + echo "### 📱 $ss_test_avd_desc" >> comment.md + echo "" >> comment.md + + # for each .png in that AVD folder + for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do + + ss_test_desc=$(basename "$ss_test" .png) + + echo "#### 🔧 $ss_test_desc" >> comment.md + + echo "$WK_DIR/$ss_test" + echo '

' >> comment.md + cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md + echo '

' >> comment.md + + done + done + + if [ "$EVENT" == 'pull_request' ] + then + sha=${{ github.event.pull_request.head.sha}} + elif [ "$EVENT" == 'workflow_run' ] + then + sha=${{ github.event.workflow_run.head_sha}} + else + sha=$GITHUB_SHA + fi + + echo "" >> comment.md + echo "###### For commit $sha" >> comment.md + + - name: Publish Screehnshots - Update or Create Comment + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + body-file: comment.md + edit-mode: replace + issue-number: ${{ github.event.number }} + + # - name: Save AVD Cache + # uses: actions/cache/save@v3 + # if: always() && !steps.avd-cache.outputs.cache-hit + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} + Test_APK_Win: + name: Test APK + runs-on: windows-latest + env: + EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + EMU_PROFILE: pixel_2 + EMU_AVD_NAME: Pixel_2 + EMU_TARGET: playstore # google_apis + + strategy: + matrix: + api-level: [30] # 29 + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Set Up JDK + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: 17 + + # Only for Testing github-actions + - uses: actions-rs/toolchain@v1 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: Swatinem/rust-cache@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + cache-on-failure: true + workspaces: ${{env.GRADLE_DIR}}/ALVR/ + + - uses: gradle/gradle-build-action@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + build-root-directory: ${{env.GRADLE_DIR}} + cache-read-only: ${{ false }} + + # - name: AVD cache + # uses: actions/cache@v3 + # id: avd-cache + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} + + ## Create AVD with some redundancy - 3 Checks + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + + - name: create AVD and generate snapshot for caching try#2 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + + - name: create AVD and generate snapshot for caching try#3 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_3 + # continue-on-error: true # Fail if even fail the 3rd try + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + ## Redundancy End + - name: Prepare deps shell: bash run: | From 49775afb0b5e54079f46bc0bde6238a2e3787308 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:08:48 +0530 Subject: [PATCH 049/107] Update build.yml --- .github/workflows/build.yml | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53acbfc5..0d78d13d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -491,13 +491,14 @@ jobs: # ~/.android/adb* # key: avd-${{ matrix.api-level }} Test_APK_Win: - name: Test APK + name: Test APK Win runs-on: windows-latest env: EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio EMU_PROFILE: pixel_2 EMU_AVD_NAME: Pixel_2 EMU_TARGET: playstore # google_apis + MATRIX_E_SDK: 30 strategy: matrix: @@ -508,6 +509,40 @@ jobs: with: submodules: 'true' + - name: Create Android emulator + shell: bash + run: | + # brew install intel-haxm + # Install AVD files + echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --licenses + + # Create emulator + $ANDROID_HOME/tools/bin/avdmanager create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + $ANDROID_HOME/emulator/emulator -list-avds + if false; then + emulator_config=~/.android/avd/$MATRIX_AVD.avd/config.ini + # The following madness is to support empty OR populated config.ini files, + # the state of which is dependant on the version of the emulator used (which we don't control), + # so let's be defensive to be safe. + # Replace existing config (NOTE we're on MacOS so sed works differently!) + # sed -i .bak 's/hw.lcd.density=.*/hw.lcd.density=420/' "$emulator_config" + # sed -i .bak 's/hw.lcd.height=.*/hw.lcd.height=1920/' "$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=420" >> "$emulator_config" + fi + if ! grep -q "hw.lcd.height" "$emulator_config"; then + echo "hw.lcd.height=1920" >> "$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: Set Up JDK uses: actions/setup-java@v3 with: From c5ec06f09dafdba82d2f7b9bc7a6df53bd1fdce0 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:10:07 +0530 Subject: [PATCH 050/107] Update build.yml --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d78d13d..66455b6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -514,14 +514,14 @@ jobs: run: | # brew install intel-haxm # Install AVD files - echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' - echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --licenses + echo "y" | $ANDROID_HOME\tools\bin\sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + echo "y" | $ANDROID_HOME\tools\bin\sdkmanager --licenses # Create emulator - $ANDROID_HOME/tools/bin/avdmanager create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' - $ANDROID_HOME/emulator/emulator -list-avds + $ANDROID_HOME\tools\bin\avdmanager create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + $ANDROID_HOME\emulator\emulator -list-avds if false; then - emulator_config=~/.android/avd/$MATRIX_AVD.avd/config.ini + emulator_config=~\.android\avd\$MATRIX_AVD.avd\config.ini # The following madness is to support empty OR populated config.ini files, # the state of which is dependant on the version of the emulator used (which we don't control), # so let's be defensive to be safe. From 7d270e328c83f58ae97f5bbf1dafae37c63c60f9 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:11:40 +0530 Subject: [PATCH 051/107] Update build.yml --- .github/workflows/build.yml | 607 ++++++++++++++++++------------------ 1 file changed, 304 insertions(+), 303 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66455b6b..fc67356e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -504,24 +504,20 @@ jobs: matrix: api-level: [30] # 29 steps: - - name: checkout - uses: actions/checkout@v3 - with: - submodules: 'true' - name: Create Android emulator shell: bash run: | # brew install intel-haxm # Install AVD files - echo "y" | $ANDROID_HOME\tools\bin\sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' - echo "y" | $ANDROID_HOME\tools\bin\sdkmanager --licenses + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager --licenses # Create emulator - $ANDROID_HOME\tools\bin\avdmanager create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' - $ANDROID_HOME\emulator\emulator -list-avds + $ANDROID_HOME\\tools\\bin\\avdmanager create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + $ANDROID_HOME\\emulator\\emulator -list-avds if false; then - emulator_config=~\.android\avd\$MATRIX_AVD.avd\config.ini + emulator_config=~\\.android\\avd\\$MATRIX_AVD.avd\\config.ini # The following madness is to support empty OR populated config.ini files, # the state of which is dependant on the version of the emulator used (which we don't control), # so let's be defensive to be safe. @@ -543,315 +539,320 @@ jobs: cat "$emulator_config" fi - - name: Set Up JDK - uses: actions/setup-java@v3 - with: - distribution: 'oracle' - java-version: 17 + # - name: checkout + # uses: actions/checkout@v3 + # with: + # submodules: 'true' + + # - name: Set Up JDK + # uses: actions/setup-java@v3 + # with: + # distribution: 'oracle' + # java-version: 17 - # Only for Testing github-actions - - uses: actions-rs/toolchain@v1 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - uses: Swatinem/rust-cache@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - cache-on-failure: true - workspaces: ${{env.GRADLE_DIR}}/ALVR/ + # # Only for Testing github-actions + # - uses: actions-rs/toolchain@v1 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # profile: minimal + # toolchain: stable + # override: true + # components: clippy + # - uses: Swatinem/rust-cache@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # cache-on-failure: true + # workspaces: ${{env.GRADLE_DIR}}/ALVR/ - - uses: gradle/gradle-build-action@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - build-root-directory: ${{env.GRADLE_DIR}} - cache-read-only: ${{ false }} - - # - name: AVD cache - # uses: actions/cache@v3 - # id: avd-cache + # - uses: gradle/gradle-build-action@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} + # build-root-directory: ${{env.GRADLE_DIR}} + # cache-read-only: ${{ false }} + + # # - name: AVD cache + # # uses: actions/cache@v3 + # # id: avd-cache + # # with: + # # path: | + # # ~/.android/avd/* + # # ~/.android/adb* + # # key: avd-${{ matrix.api-level }} - ## Create AVD with some redundancy - 3 Checks - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_1 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." + # ## Create AVD with some redundancy - 3 Checks + # - name: create AVD and generate snapshot for caching + # if: steps.avd-cache.outputs.cache-hit != 'true' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_1 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." - - name: create AVD and generate snapshot for caching try#2 - if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_2 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." + # - name: create AVD and generate snapshot for caching try#2 + # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_2 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." - - name: create AVD and generate snapshot for caching try#3 - if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_3 - # continue-on-error: true # Fail if even fail the 3rd try - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." - ## Redundancy End - - - name: Prepare deps - shell: bash - run: | - ls -alh - cd code/mobile/android/PhoneVR - chmod +x prepare-alvr-deps.sh - bash prepare-alvr-deps.sh - - - name: Change gradle wrapper permissions - run: | - echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs - cat ~/.android/advancedFeatures.ini + # - name: create AVD and generate snapshot for caching try#3 + # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_3 + # # continue-on-error: true # Fail if even fail the 3rd try + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." + # ## Redundancy End + + # - name: Prepare deps + # shell: bash + # run: | + # ls -alh + # cd code/mobile/android/PhoneVR + # chmod +x prepare-alvr-deps.sh + # bash prepare-alvr-deps.sh + + # - name: Change gradle wrapper permissions + # run: | + # echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs + # cat ~/.android/advancedFeatures.ini - cd code/mobile/android/PhoneVR - chmod +x ./gradlew - ls -alh - ls -alh app + # cd code/mobile/android/PhoneVR + # chmod +x ./gradlew + # ls -alh + # ls -alh app - # Cache APK gradle tasks - - name: Build apk debug project (APK) - run: | - cd code/mobile/android/PhoneVR - ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - - name: Start PVR ADB-Telnet Server - working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - run: | - brew install telnet - - chmod +x pvr-adb-telnet.sh - bash pvr-adb-telnet.sh >> log.txt 2>&1 & - - - name: Install recorder and record session - env: - SUFFIX: ${{ matrix.api-level }} - run: | - brew install glfw3 - brew install glew - brew install glxinfo - - # glxinfo | grep -i opengl - - brew install ffmpeg - ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & - - ## Create AVD with some redundancy - 3 Checks - - name: Run tests - uses: reactivecircus/android-emulator-runner@v2 - id: avd_run_1 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + # # Cache APK gradle tasks + # - name: Build apk debug project (APK) + # run: | + # cd code/mobile/android/PhoneVR + # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + # - name: Start PVR ADB-Telnet Server + # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + # run: | + # brew install telnet + + # chmod +x pvr-adb-telnet.sh + # bash pvr-adb-telnet.sh >> log.txt 2>&1 & + + # - name: Install recorder and record session + # env: + # SUFFIX: ${{ matrix.api-level }} + # run: | + # brew install glfw3 + # brew install glew + # brew install glxinfo + + # # glxinfo | grep -i opengl + + # brew install ffmpeg + # ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + + # ## Create AVD with some redundancy - 3 Checks + # - name: Run tests + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_run_1 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log - - name: Run tests try#2 - uses: reactivecircus/android-emulator-runner@v2 - if: steps.avd_run_1.outcome == 'failure' - id: avd_run_2 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + # - name: Run tests try#2 + # uses: reactivecircus/android-emulator-runner@v2 + # if: steps.avd_run_1.outcome == 'failure' + # id: avd_run_2 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log - - name: Run tests try#3 - uses: reactivecircus/android-emulator-runner@v2 - if: steps.avd_run_2.outcome == 'failure' - id: avd_run_3 - # continue-on-error: true # Fail if even fail the 3rd try - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log - ## Redundancy End - - - name: Get Bug Report & tombstones - if: always() - run: | - adb bugreport bugreport.zip + # - name: Run tests try#3 + # uses: reactivecircus/android-emulator-runner@v2 + # if: steps.avd_run_2.outcome == 'failure' + # id: avd_run_3 + # # continue-on-error: true # Fail if even fail the 3rd try + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log + # ## Redundancy End + + # - name: Get Bug Report & tombstones + # if: always() + # run: | + # adb bugreport bugreport.zip - - name: Shutdown PVR ADB-Telnet Server and log - working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - if: always() - run: | - echo "shutdown meow !" >> pvr-adb-telnet.sd - cat log.txt - - # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test results - path: | - **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - **/app/build/reports - **/app/build/test-results - **/app/build/outputs/androidTest-results - ${{env.GRADLE_DIR}}/logcat.log - ./*.mov - bugreport.zip + # - name: Shutdown PVR ADB-Telnet Server and log + # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + # if: always() + # run: | + # echo "shutdown meow !" >> pvr-adb-telnet.sd + # cat log.txt + + # # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + # - uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: Test results + # path: | + # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + # **/app/build/reports + # **/app/build/test-results + # **/app/build/outputs/androidTest-results + # ${{env.GRADLE_DIR}}/logcat.log + # ./*.mov + # bugreport.zip - # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - - name: Publish Test Results in Comment - uses: EnricoMi/publish-unit-test-result-action/composite@v2 - # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - if: always() - with: - report_individual_runs: true - report_suite_logs: 'any' - deduplicate_classes_by_file_name: true - comment_title: '🛠 Test Results' - files: | - code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml + # - name: Publish Test Results in Comment + # uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + # if: always() + # with: + # report_individual_runs: true + # report_suite_logs: 'any' + # deduplicate_classes_by_file_name: true + # comment_title: '🛠 Test Results' + # files: | + # code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml - - uses: iterative/setup-cml@v1 - if: always() + # - uses: iterative/setup-cml@v1 + # if: always() - - name: Publish Screenshots - Find Comment - if: always() - uses: peter-evans/find-comment@v2 - id: fc - with: - issue-number: ${{ github.event.number }} - body-includes: '# 📷 Screenshots of tests:' - direction: last - comment-author: 'github-actions[bot]' - - - name: Publish Screenshots - build comment - if: always() - env: - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - EVENT: ${{ github.event_name }} - REF: ${{ github.ref }} - WK_DIR: ${{env.GRADLE_DIR}} - shell: bash - working-directory: ${{env.GRADLE_DIR}} - run: | - echo "# 📷 Screenshots of tests:" >> comment.md - echo "" >> comment.md - - ls -alh - ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - - # for each AVD Image - for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do - - ls -alh "$ss_test_avd" - echo "$ss_test_avd" - ss_test_avd_desc=$(basename "$ss_test_avd") - - echo "" >> comment.md - echo "### 📱 $ss_test_avd_desc" >> comment.md - echo "" >> comment.md - - # for each .png in that AVD folder - for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do + # - name: Publish Screenshots - Find Comment + # if: always() + # uses: peter-evans/find-comment@v2 + # id: fc + # with: + # issue-number: ${{ github.event.number }} + # body-includes: '# 📷 Screenshots of tests:' + # direction: last + # comment-author: 'github-actions[bot]' + + # - name: Publish Screenshots - build comment + # if: always() + # env: + # REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # EVENT: ${{ github.event_name }} + # REF: ${{ github.ref }} + # WK_DIR: ${{env.GRADLE_DIR}} + # shell: bash + # working-directory: ${{env.GRADLE_DIR}} + # run: | + # echo "# 📷 Screenshots of tests:" >> comment.md + # echo "" >> comment.md + + # ls -alh + # ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + + # # for each AVD Image + # for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + + # ls -alh "$ss_test_avd" + # echo "$ss_test_avd" + # ss_test_avd_desc=$(basename "$ss_test_avd") + + # echo "" >> comment.md + # echo "### 📱 $ss_test_avd_desc" >> comment.md + # echo "" >> comment.md + + # # for each .png in that AVD folder + # for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do - ss_test_desc=$(basename "$ss_test" .png) + # ss_test_desc=$(basename "$ss_test" .png) - echo "#### 🔧 $ss_test_desc" >> comment.md - - echo "$WK_DIR/$ss_test" - echo '

' >> comment.md - cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md - echo '

' >> comment.md - - done - done - - if [ "$EVENT" == 'pull_request' ] - then - sha=${{ github.event.pull_request.head.sha}} - elif [ "$EVENT" == 'workflow_run' ] - then - sha=${{ github.event.workflow_run.head_sha}} - else - sha=$GITHUB_SHA - fi - - echo "" >> comment.md - echo "###### For commit $sha" >> comment.md + # echo "#### 🔧 $ss_test_desc" >> comment.md + + # echo "$WK_DIR/$ss_test" + # echo '

' >> comment.md + # cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md + # echo '

' >> comment.md + + # done + # done + + # if [ "$EVENT" == 'pull_request' ] + # then + # sha=${{ github.event.pull_request.head.sha}} + # elif [ "$EVENT" == 'workflow_run' ] + # then + # sha=${{ github.event.workflow_run.head_sha}} + # else + # sha=$GITHUB_SHA + # fi + + # echo "" >> comment.md + # echo "###### For commit $sha" >> comment.md - - name: Publish Screehnshots - Update or Create Comment - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - body-file: comment.md - edit-mode: replace - issue-number: ${{ github.event.number }} - - # - name: Save AVD Cache - # uses: actions/cache/save@v3 - # if: always() && !steps.avd-cache.outputs.cache-hit + # - name: Publish Screehnshots - Update or Create Comment + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + # uses: peter-evans/create-or-update-comment@v3 # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} + # comment-id: ${{ steps.fc.outputs.comment-id }} + # body-file: comment.md + # edit-mode: replace + # issue-number: ${{ github.event.number }} + + # # - name: Save AVD Cache + # # uses: actions/cache/save@v3 + # # if: always() && !steps.avd-cache.outputs.cache-hit + # # with: + # # path: | + # # ~/.android/avd/* + # # ~/.android/adb* + # # key: avd-${{ matrix.api-level }} From 1d4faa67661f6e43b89e9150ba7868f815397606 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:13:55 +0530 Subject: [PATCH 052/107] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc67356e..ba75eeb5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -510,11 +510,11 @@ jobs: run: | # brew install intel-haxm # Install AVD files - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager --licenses + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses # Create emulator - $ANDROID_HOME\\tools\\bin\\avdmanager create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' $ANDROID_HOME\\emulator\\emulator -list-avds if false; then emulator_config=~\\.android\\avd\\$MATRIX_AVD.avd\\config.ini From a808cfe50e9cafd98723a47150ad9cd8c74f2a25 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:16:57 +0530 Subject: [PATCH 053/107] Update build.yml --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba75eeb5..bb4239a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -499,6 +499,7 @@ jobs: EMU_AVD_NAME: Pixel_2 EMU_TARGET: playstore # google_apis MATRIX_E_SDK: 30 + MATRIX_AVD: test_win strategy: matrix: @@ -510,6 +511,7 @@ jobs: run: | # brew install intel-haxm # Install AVD files + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses From 6778c811ca2812b0bf05ab5dcdb19cbdff8d0ace Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:21:21 +0530 Subject: [PATCH 054/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb4239a6..eb350e30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -515,8 +515,8 @@ jobs: echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses - # Create emulator - $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + echo Creating emulator + $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86' $ANDROID_HOME\\emulator\\emulator -list-avds if false; then emulator_config=~\\.android\\avd\\$MATRIX_AVD.avd\\config.ini From 86856f9a6bd00fae6325f6607f2904f0830f1735 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:22:18 +0530 Subject: [PATCH 055/107] Update build.yml --- .github/workflows/build.yml | 610 ++++++++++++++++++------------------ 1 file changed, 305 insertions(+), 305 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb350e30..bed99fad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,336 +160,336 @@ jobs: # name: build-files # path: ${{ env.GRADLE_DIR }}/app/.cxx/ - Test_APK: - name: Test APK - runs-on: macos-latest - env: - EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio - EMU_PROFILE: pixel_2 - EMU_AVD_NAME: Pixel_2 - EMU_TARGET: playstore # google_apis + # Test_APK: + # name: Test APK + # runs-on: macos-latest + # env: + # EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + # EMU_PROFILE: pixel_2 + # EMU_AVD_NAME: Pixel_2 + # EMU_TARGET: playstore # google_apis - strategy: - matrix: - api-level: [30] # 29 - steps: - - name: checkout - uses: actions/checkout@v3 - with: - submodules: 'true' - - - name: Set Up JDK - uses: actions/setup-java@v3 - with: - distribution: 'oracle' - java-version: 17 - - # Only for Testing github-actions - - uses: actions-rs/toolchain@v1 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - uses: Swatinem/rust-cache@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - cache-on-failure: true - workspaces: ${{env.GRADLE_DIR}}/ALVR/ + # strategy: + # matrix: + # api-level: [30] # 29 + # steps: + # - name: checkout + # uses: actions/checkout@v3 + # with: + # submodules: 'true' + + # - name: Set Up JDK + # uses: actions/setup-java@v3 + # with: + # distribution: 'oracle' + # java-version: 17 + + # # Only for Testing github-actions + # - uses: actions-rs/toolchain@v1 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # profile: minimal + # toolchain: stable + # override: true + # components: clippy + # - uses: Swatinem/rust-cache@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # cache-on-failure: true + # workspaces: ${{env.GRADLE_DIR}}/ALVR/ - - uses: gradle/gradle-build-action@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - build-root-directory: ${{env.GRADLE_DIR}} - cache-read-only: ${{ false }} - - # - name: AVD cache - # uses: actions/cache@v3 - # id: avd-cache - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} + # - uses: gradle/gradle-build-action@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # build-root-directory: ${{env.GRADLE_DIR}} + # cache-read-only: ${{ false }} + + # # - name: AVD cache + # # uses: actions/cache@v3 + # # id: avd-cache + # # with: + # # path: | + # # ~/.android/avd/* + # # ~/.android/adb* + # # key: avd-${{ matrix.api-level }} - ## Create AVD with some redundancy - 3 Checks - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_1 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." + # ## Create AVD with some redundancy - 3 Checks + # - name: create AVD and generate snapshot for caching + # if: steps.avd-cache.outputs.cache-hit != 'true' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_1 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." - - name: create AVD and generate snapshot for caching try#2 - if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_2 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." + # - name: create AVD and generate snapshot for caching try#2 + # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_2 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." - - name: create AVD and generate snapshot for caching try#3 - if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_3 - # continue-on-error: true # Fail if even fail the 3rd try - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." - ## Redundancy End - - - name: Prepare deps - shell: bash - run: | - ls -alh - cd code/mobile/android/PhoneVR - chmod +x prepare-alvr-deps.sh - bash prepare-alvr-deps.sh + # - name: create AVD and generate snapshot for caching try#3 + # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_3 + # # continue-on-error: true # Fail if even fail the 3rd try + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." + # ## Redundancy End - - name: Change gradle wrapper permissions - run: | - echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs - cat ~/.android/advancedFeatures.ini + # - name: Prepare deps + # shell: bash + # run: | + # ls -alh + # cd code/mobile/android/PhoneVR + # chmod +x prepare-alvr-deps.sh + # bash prepare-alvr-deps.sh + + # - name: Change gradle wrapper permissions + # run: | + # echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs + # cat ~/.android/advancedFeatures.ini - cd code/mobile/android/PhoneVR - chmod +x ./gradlew - ls -alh - ls -alh app + # cd code/mobile/android/PhoneVR + # chmod +x ./gradlew + # ls -alh + # ls -alh app - # Cache APK gradle tasks - - name: Build apk debug project (APK) - run: | - cd code/mobile/android/PhoneVR - ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - - name: Start PVR ADB-Telnet Server - working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - run: | - brew install telnet + # # Cache APK gradle tasks + # - name: Build apk debug project (APK) + # run: | + # cd code/mobile/android/PhoneVR + # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + # - name: Start PVR ADB-Telnet Server + # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + # run: | + # brew install telnet - chmod +x pvr-adb-telnet.sh - bash pvr-adb-telnet.sh >> log.txt 2>&1 & + # chmod +x pvr-adb-telnet.sh + # bash pvr-adb-telnet.sh >> log.txt 2>&1 & - - name: Install recorder and record session - env: - SUFFIX: ${{ matrix.api-level }} - run: | - brew install glfw3 - brew install glew - brew install glxinfo - - # glxinfo | grep -i opengl - - brew install ffmpeg - ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & - - ## Create AVD with some redundancy - 3 Checks - - name: Run tests - uses: reactivecircus/android-emulator-runner@v2 - id: avd_run_1 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + # - name: Install recorder and record session + # env: + # SUFFIX: ${{ matrix.api-level }} + # run: | + # brew install glfw3 + # brew install glew + # brew install glxinfo + + # # glxinfo | grep -i opengl + + # brew install ffmpeg + # ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + + # ## Create AVD with some redundancy - 3 Checks + # - name: Run tests + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_run_1 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log - - name: Run tests try#2 - uses: reactivecircus/android-emulator-runner@v2 - if: steps.avd_run_1.outcome == 'failure' - id: avd_run_2 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + # - name: Run tests try#2 + # uses: reactivecircus/android-emulator-runner@v2 + # if: steps.avd_run_1.outcome == 'failure' + # id: avd_run_2 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log - - name: Run tests try#3 - uses: reactivecircus/android-emulator-runner@v2 - if: steps.avd_run_2.outcome == 'failure' - id: avd_run_3 - # continue-on-error: true # Fail if even fail the 3rd try - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log - ## Redundancy End - - - name: Get Bug Report & tombstones - if: always() - run: | - adb bugreport bugreport.zip + # - name: Run tests try#3 + # uses: reactivecircus/android-emulator-runner@v2 + # if: steps.avd_run_2.outcome == 'failure' + # id: avd_run_3 + # # continue-on-error: true # Fail if even fail the 3rd try + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log + # ## Redundancy End + + # - name: Get Bug Report & tombstones + # if: always() + # run: | + # adb bugreport bugreport.zip - - name: Shutdown PVR ADB-Telnet Server and log - working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - if: always() - run: | - echo "shutdown meow !" >> pvr-adb-telnet.sd - cat log.txt - - # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test results - path: | - **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - **/app/build/reports - **/app/build/test-results - **/app/build/outputs/androidTest-results - ${{env.GRADLE_DIR}}/logcat.log - ./*.mov - bugreport.zip + # - name: Shutdown PVR ADB-Telnet Server and log + # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + # if: always() + # run: | + # echo "shutdown meow !" >> pvr-adb-telnet.sd + # cat log.txt + + # # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + # - uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: Test results + # path: | + # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + # **/app/build/reports + # **/app/build/test-results + # **/app/build/outputs/androidTest-results + # ${{env.GRADLE_DIR}}/logcat.log + # ./*.mov + # bugreport.zip - # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - - name: Publish Test Results in Comment - uses: EnricoMi/publish-unit-test-result-action/composite@v2 - # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - if: always() - with: - report_individual_runs: true - report_suite_logs: 'any' - deduplicate_classes_by_file_name: true - comment_title: '🛠 Test Results' - files: | - code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml + # - name: Publish Test Results in Comment + # uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + # if: always() + # with: + # report_individual_runs: true + # report_suite_logs: 'any' + # deduplicate_classes_by_file_name: true + # comment_title: '🛠 Test Results' + # files: | + # code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml - - uses: iterative/setup-cml@v1 - if: always() + # - uses: iterative/setup-cml@v1 + # if: always() - - name: Publish Screenshots - Find Comment - if: always() - uses: peter-evans/find-comment@v2 - id: fc - with: - issue-number: ${{ github.event.number }} - body-includes: '# 📷 Screenshots of tests:' - direction: last - comment-author: 'github-actions[bot]' - - - name: Publish Screenshots - build comment - if: always() - env: - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - EVENT: ${{ github.event_name }} - REF: ${{ github.ref }} - WK_DIR: ${{env.GRADLE_DIR}} - shell: bash - working-directory: ${{env.GRADLE_DIR}} - run: | - echo "# 📷 Screenshots of tests:" >> comment.md - echo "" >> comment.md + # - name: Publish Screenshots - Find Comment + # if: always() + # uses: peter-evans/find-comment@v2 + # id: fc + # with: + # issue-number: ${{ github.event.number }} + # body-includes: '# 📷 Screenshots of tests:' + # direction: last + # comment-author: 'github-actions[bot]' + + # - name: Publish Screenshots - build comment + # if: always() + # env: + # REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # EVENT: ${{ github.event_name }} + # REF: ${{ github.ref }} + # WK_DIR: ${{env.GRADLE_DIR}} + # shell: bash + # working-directory: ${{env.GRADLE_DIR}} + # run: | + # echo "# 📷 Screenshots of tests:" >> comment.md + # echo "" >> comment.md - ls -alh - ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + # ls -alh + # ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - # for each AVD Image - for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + # # for each AVD Image + # for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do - ls -alh "$ss_test_avd" - echo "$ss_test_avd" - ss_test_avd_desc=$(basename "$ss_test_avd") + # ls -alh "$ss_test_avd" + # echo "$ss_test_avd" + # ss_test_avd_desc=$(basename "$ss_test_avd") - echo "" >> comment.md - echo "### 📱 $ss_test_avd_desc" >> comment.md - echo "" >> comment.md + # echo "" >> comment.md + # echo "### 📱 $ss_test_avd_desc" >> comment.md + # echo "" >> comment.md - # for each .png in that AVD folder - for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do + # # for each .png in that AVD folder + # for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do - ss_test_desc=$(basename "$ss_test" .png) + # ss_test_desc=$(basename "$ss_test" .png) - echo "#### 🔧 $ss_test_desc" >> comment.md - - echo "$WK_DIR/$ss_test" - echo '

' >> comment.md - cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md - echo '

' >> comment.md - - done - done - - if [ "$EVENT" == 'pull_request' ] - then - sha=${{ github.event.pull_request.head.sha}} - elif [ "$EVENT" == 'workflow_run' ] - then - sha=${{ github.event.workflow_run.head_sha}} - else - sha=$GITHUB_SHA - fi - - echo "" >> comment.md - echo "###### For commit $sha" >> comment.md + # echo "#### 🔧 $ss_test_desc" >> comment.md + + # echo "$WK_DIR/$ss_test" + # echo '

' >> comment.md + # cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md + # echo '

' >> comment.md + + # done + # done + + # if [ "$EVENT" == 'pull_request' ] + # then + # sha=${{ github.event.pull_request.head.sha}} + # elif [ "$EVENT" == 'workflow_run' ] + # then + # sha=${{ github.event.workflow_run.head_sha}} + # else + # sha=$GITHUB_SHA + # fi + + # echo "" >> comment.md + # echo "###### For commit $sha" >> comment.md - - name: Publish Screehnshots - Update or Create Comment - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - body-file: comment.md - edit-mode: replace - issue-number: ${{ github.event.number }} + # - name: Publish Screehnshots - Update or Create Comment + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + # uses: peter-evans/create-or-update-comment@v3 + # with: + # comment-id: ${{ steps.fc.outputs.comment-id }} + # body-file: comment.md + # edit-mode: replace + # issue-number: ${{ github.event.number }} - # - name: Save AVD Cache - # uses: actions/cache/save@v3 - # if: always() && !steps.avd-cache.outputs.cache-hit - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} + # # - name: Save AVD Cache + # # uses: actions/cache/save@v3 + # # if: always() && !steps.avd-cache.outputs.cache-hit + # # with: + # # path: | + # # ~/.android/avd/* + # # ~/.android/adb* + # # key: avd-${{ matrix.api-level }} Test_APK_Win: name: Test APK Win runs-on: windows-latest From 1dc8ed33a006b807b561c95274b8ad92dc78ea82 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:28:25 +0530 Subject: [PATCH 056/107] Update build.yml --- .github/workflows/build.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bed99fad..3a225684 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -505,6 +505,9 @@ jobs: matrix: api-level: [30] # 29 steps: + - uses: FedericoCarboni/setup-ffmpeg@v2 + id: setup-ffmpeg + - run: ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & - name: Create Android emulator shell: bash @@ -746,19 +749,19 @@ jobs: # echo "shutdown meow !" >> pvr-adb-telnet.sd # cat log.txt - # # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - # - uses: actions/upload-artifact@v3 - # if: always() - # with: - # name: Test results - # path: | - # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - # **/app/build/reports - # **/app/build/test-results - # **/app/build/outputs/androidTest-results - # ${{env.GRADLE_DIR}}/logcat.log - # ./*.mov - # bugreport.zip + # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + - uses: actions/upload-artifact@v3 + if: always() + with: + name: Test results + path: | + # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + # **/app/build/reports + # **/app/build/test-results + # **/app/build/outputs/androidTest-results + # ${{env.GRADLE_DIR}}/logcat.log + ./*.mov + # bugreport.zip # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment From 147cd9d02443a14d156953f013d6fb0fc5672511 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:31:30 +0530 Subject: [PATCH 057/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a225684..246d495b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -497,7 +497,7 @@ jobs: EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio EMU_PROFILE: pixel_2 EMU_AVD_NAME: Pixel_2 - EMU_TARGET: playstore # google_apis + EMU_TARGET: google_apis_playstore # google_apis MATRIX_E_SDK: 30 MATRIX_AVD: test_win @@ -515,7 +515,7 @@ jobs: # brew install intel-haxm # Install AVD files - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';default;x86_64' + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';default;x86' echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses echo Creating emulator From 4394f8fe0a58565952cbd21323a8819086e75207 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:32:20 +0530 Subject: [PATCH 058/107] Update build.yml --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 246d495b..a8f23eda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -750,18 +750,18 @@ jobs: # cat log.txt # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test results - path: | # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* # **/app/build/reports # **/app/build/test-results # **/app/build/outputs/androidTest-results # ${{env.GRADLE_DIR}}/logcat.log - ./*.mov # bugreport.zip + - uses: actions/upload-artifact@v3 + if: always() + with: + name: Test results + path: | + .\*.mov # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment From 8c8557ce7657cb501ce57fd0f3cfcf849e6baa23 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:34:28 +0530 Subject: [PATCH 059/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8f23eda..d84a7a8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -515,11 +515,11 @@ jobs: # brew install intel-haxm # Install AVD files - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';default;x86' + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses echo Creating emulator - $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';default;x86' + $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' $ANDROID_HOME\\emulator\\emulator -list-avds if false; then emulator_config=~\\.android\\avd\\$MATRIX_AVD.avd\\config.ini From 3a3eb7202d85740cdb1119535ab848df9c585c91 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:36:50 +0530 Subject: [PATCH 060/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d84a7a8a..d5e8f76e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -507,7 +507,7 @@ jobs: steps: - uses: FedericoCarboni/setup-ffmpeg@v2 id: setup-ffmpeg - - run: ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + - run: ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & - name: Create Android emulator shell: bash @@ -761,7 +761,7 @@ jobs: with: name: Test results path: | - .\*.mov + ./*.mov # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment From 82c8a0bb9433061a3ce3bb165416be8be4525172 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:40:18 +0530 Subject: [PATCH 061/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5e8f76e..35f6e3b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -515,8 +515,8 @@ jobs: # brew install intel-haxm # Install AVD files - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' > /dev/null + echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses > /dev/null echo Creating emulator $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' From b96d26b11447ca4c74b030d6442e44be47310b64 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:40:58 +0530 Subject: [PATCH 062/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35f6e3b9..3cb4a1a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -507,7 +507,7 @@ jobs: steps: - uses: FedericoCarboni/setup-ffmpeg@v2 id: setup-ffmpeg - - run: ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + - run: ffmpeg -f avfoundation -i 0 -t 120 .\out_API$SUFFIX.mov & - name: Create Android emulator shell: bash From a385df6e2fb86d007a78f2f1b7af39e3031909e6 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:45:07 +0530 Subject: [PATCH 063/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cb4a1a4..4fdfef43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -761,7 +761,7 @@ jobs: with: name: Test results path: | - ./*.mov + .*.mov # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment From 427a1c49baace3a8fb15a9c11166422a27df7834 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:47:05 +0530 Subject: [PATCH 064/107] Update build.yml --- .github/workflows/build.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4fdfef43..35e7a887 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -544,6 +544,24 @@ jobs: cat "$emulator_config" fi + - name: Start Android emulator + timeout-minutes: 30 # ~4min normal - 3x DOSafety + env: + SUFFIX: ${{ matrix.android_avd }}-eAPI-${{ matrix.android_emu_version }}-${{ matrix.os }} + shell: bash + run: | + echo "Starting emulator and waiting for boot to complete...." + ls -la $ANDROID_HOME\\emulator + nohup $ANDROID_HOME\\tools\\emulator -avd $MATRIX_AVD -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$SUFFIX.jpg + + $ANDROID_HOME\\platform-tools\\adb exec-out screencap -p > emulator$SUFFIX.png + # - name: checkout # uses: actions/checkout@v3 # with: @@ -762,6 +780,7 @@ jobs: name: Test results path: | .*.mov + .*.png # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment From a6c18db2ad7327f8eb1641f75059274c9a4a957c Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:49:21 +0530 Subject: [PATCH 065/107] Update build.yml --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35e7a887..326e48cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -507,7 +507,8 @@ jobs: steps: - uses: FedericoCarboni/setup-ffmpeg@v2 id: setup-ffmpeg - - run: ffmpeg -f avfoundation -i 0 -t 120 .\out_API$SUFFIX.mov & + - run: ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + shell: bash - name: Create Android emulator shell: bash From e6a72b2a6ecdaf52f701443a41929f4bb440b5e8 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:55:25 +0530 Subject: [PATCH 066/107] Update build.yml --- .github/workflows/build.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 326e48cb..3f16d442 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -507,7 +507,10 @@ jobs: steps: - uses: FedericoCarboni/setup-ffmpeg@v2 id: setup-ffmpeg - - run: ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + - run: | + ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + npm install --global nircmd + nircmd --help shell: bash - name: Create Android emulator @@ -559,10 +562,12 @@ jobs: $ANDROID_HOME\\platform-tools\\adb devices sleep 30 - # screencapture screenshot$SUFFIX.jpg + nircmd savescreenshot screenshot$SUFFIX.jpg $ANDROID_HOME\\platform-tools\\adb exec-out screencap -p > emulator$SUFFIX.png + ls -alh + # - name: checkout # uses: actions/checkout@v3 # with: @@ -782,7 +787,8 @@ jobs: path: | .*.mov .*.png - + .*.jpg + # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment # uses: EnricoMi/publish-unit-test-result-action/composite@v2 From 1c7eac6479f9bfa544bbafdcd42920463fd2107c Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 00:59:37 +0530 Subject: [PATCH 067/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f16d442..3282f281 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -508,7 +508,7 @@ jobs: - uses: FedericoCarboni/setup-ffmpeg@v2 id: setup-ffmpeg - run: | - ffmpeg -f avfoundation -i 0 -t 120 out_API$SUFFIX.mov & + ffmpeg -f gdigrab -framerate 30 -i desktop -t 120 out_API$SUFFIX.mov & npm install --global nircmd nircmd --help shell: bash From 9620f0425f04f770e0d7e80dcf73a46b07846d62 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 01:28:31 +0530 Subject: [PATCH 068/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3282f281..4f79f98f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -556,7 +556,7 @@ jobs: run: | echo "Starting emulator and waiting for boot to complete...." ls -la $ANDROID_HOME\\emulator - nohup $ANDROID_HOME\\tools\\emulator -avd $MATRIX_AVD -gpu host -no-audio -no-boot-anim -camera-back none -camera-front none -qemu -m 2048 2>&1 & + nohup $ANDROID_HOME\\tools\\emulator -avd $MATRIX_AVD -gpu swiftshader_indirect -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 From 30e95dc1513865d84be594ba8a784ea8c24e698f Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 09:40:00 +0530 Subject: [PATCH 069/107] Update build.yml --- .github/workflows/build.yml | 746 ++++++++++++++++++------------------ 1 file changed, 373 insertions(+), 373 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f79f98f..f362567c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,413 +160,413 @@ jobs: # name: build-files # path: ${{ env.GRADLE_DIR }}/app/.cxx/ - # Test_APK: - # name: Test APK - # runs-on: macos-latest - # env: - # EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio - # EMU_PROFILE: pixel_2 - # EMU_AVD_NAME: Pixel_2 - # EMU_TARGET: playstore # google_apis + Test_APK: + name: Test APK + runs-on: macos-latest + env: + EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + EMU_PROFILE: pixel_2 + EMU_AVD_NAME: Pixel_2 + EMU_TARGET: playstore # google_apis - # strategy: - # matrix: - # api-level: [30] # 29 - # steps: - # - name: checkout - # uses: actions/checkout@v3 - # with: - # submodules: 'true' + strategy: + matrix: + api-level: [30] # 29 + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: 'true' - # - name: Set Up JDK - # uses: actions/setup-java@v3 - # with: - # distribution: 'oracle' - # java-version: 17 + - name: Set Up JDK + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: 17 - # # Only for Testing github-actions - # - uses: actions-rs/toolchain@v1 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # profile: minimal - # toolchain: stable - # override: true - # components: clippy - # - uses: Swatinem/rust-cache@v2 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # cache-on-failure: true - # workspaces: ${{env.GRADLE_DIR}}/ALVR/ + # Only for Testing github-actions + - uses: actions-rs/toolchain@v1 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: Swatinem/rust-cache@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + cache-on-failure: true + workspaces: ${{env.GRADLE_DIR}}/ALVR/ - # - uses: gradle/gradle-build-action@v2 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # build-root-directory: ${{env.GRADLE_DIR}} - # cache-read-only: ${{ false }} + - uses: gradle/gradle-build-action@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + build-root-directory: ${{env.GRADLE_DIR}} + cache-read-only: ${{ false }} - # # - name: AVD cache - # # uses: actions/cache@v3 - # # id: avd-cache - # # with: - # # path: | - # # ~/.android/avd/* - # # ~/.android/adb* - # # key: avd-${{ matrix.api-level }} + # - name: AVD cache + # uses: actions/cache@v3 + # id: avd-cache + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} - # ## Create AVD with some redundancy - 3 Checks - # - name: create AVD and generate snapshot for caching - # if: steps.avd-cache.outputs.cache-hit != 'true' - # uses: reactivecircus/android-emulator-runner@v2 - # id: avd_create_1 - # continue-on-error: true - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # target: ${{ env.EMU_TARGET }} - # force-avd-creation: false - # emulator-options: ${{ env.EMU_OPTS }} - # disable-animations: false - # profile: ${{ env.EMU_PROFILE }} - # avd-name: ${{ env.EMU_AVD_NAME }} - # script: echo "Generated AVD snapshot for caching." + ## Create AVD with some redundancy - 3 Checks + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." - # - name: create AVD and generate snapshot for caching try#2 - # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' - # uses: reactivecircus/android-emulator-runner@v2 - # id: avd_create_2 - # continue-on-error: true - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # target: ${{ env.EMU_TARGET }} - # force-avd-creation: false - # emulator-options: ${{ env.EMU_OPTS }} - # disable-animations: false - # profile: ${{ env.EMU_PROFILE }} - # avd-name: ${{ env.EMU_AVD_NAME }} - # script: echo "Generated AVD snapshot for caching." + - name: create AVD and generate snapshot for caching try#2 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." - # - name: create AVD and generate snapshot for caching try#3 - # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' - # uses: reactivecircus/android-emulator-runner@v2 - # id: avd_create_3 - # # continue-on-error: true # Fail if even fail the 3rd try - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # target: ${{ env.EMU_TARGET }} - # force-avd-creation: false - # emulator-options: ${{ env.EMU_OPTS }} - # disable-animations: false - # profile: ${{ env.EMU_PROFILE }} - # avd-name: ${{ env.EMU_AVD_NAME }} - # script: echo "Generated AVD snapshot for caching." - # ## Redundancy End - - # - name: Prepare deps - # shell: bash - # run: | - # ls -alh - # cd code/mobile/android/PhoneVR - # chmod +x prepare-alvr-deps.sh - # bash prepare-alvr-deps.sh + - name: create AVD and generate snapshot for caching try#3 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_3 + # continue-on-error: true # Fail if even fail the 3rd try + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + ## Redundancy End + + - name: Prepare deps + shell: bash + run: | + ls -alh + cd code/mobile/android/PhoneVR + chmod +x prepare-alvr-deps.sh + bash prepare-alvr-deps.sh - # - name: Change gradle wrapper permissions - # run: | - # echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs - # cat ~/.android/advancedFeatures.ini + - name: Change gradle wrapper permissions + run: | + echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs + cat ~/.android/advancedFeatures.ini - # cd code/mobile/android/PhoneVR - # chmod +x ./gradlew - # ls -alh - # ls -alh app + cd code/mobile/android/PhoneVR + chmod +x ./gradlew + ls -alh + ls -alh app - # # Cache APK gradle tasks - # - name: Build apk debug project (APK) - # run: | - # cd code/mobile/android/PhoneVR - # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - # - name: Start PVR ADB-Telnet Server - # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - # run: | - # brew install telnet + # Cache APK gradle tasks + - name: Build apk debug project (APK) + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + - name: Start PVR ADB-Telnet Server + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + run: | + brew install telnet - # chmod +x pvr-adb-telnet.sh - # bash pvr-adb-telnet.sh >> log.txt 2>&1 & + chmod +x pvr-adb-telnet.sh + bash pvr-adb-telnet.sh >> log.txt 2>&1 & - # - name: Install recorder and record session - # env: - # SUFFIX: ${{ matrix.api-level }} - # run: | - # brew install glfw3 - # brew install glew - # brew install glxinfo + - name: Install recorder and record session + env: + SUFFIX: ${{ matrix.api-level }} + run: | + brew install glfw3 + brew install glew + brew install glxinfo - # # glxinfo | grep -i opengl + # glxinfo | grep -i opengl - # brew install ffmpeg - # ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + brew install ffmpeg + ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & - # ## Create AVD with some redundancy - 3 Checks - # - name: Run tests - # uses: reactivecircus/android-emulator-runner@v2 - # id: avd_run_1 - # continue-on-error: true - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # target: ${{ env.EMU_TARGET }} - # force-avd-creation: false - # emulator-options: ${{ env.EMU_OPTS }} - # disable-animations: true - # profile: ${{ env.EMU_PROFILE }} - # avd-name: ${{ env.EMU_AVD_NAME }} - # script: | - # adb shell "logcat -b all -v color" & - # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # adb shell "logcat -b all" >> logcat.log + ## Create AVD with some redundancy - 3 Checks + - name: Run tests + uses: reactivecircus/android-emulator-runner@v2 + id: avd_run_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log - # - name: Run tests try#2 - # uses: reactivecircus/android-emulator-runner@v2 - # if: steps.avd_run_1.outcome == 'failure' - # id: avd_run_2 - # continue-on-error: true - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # target: ${{ env.EMU_TARGET }} - # force-avd-creation: false - # emulator-options: ${{ env.EMU_OPTS }} - # disable-animations: true - # profile: ${{ env.EMU_PROFILE }} - # avd-name: ${{ env.EMU_AVD_NAME }} - # script: | - # adb shell "logcat -b all -v color" & - # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # adb shell "logcat -b all" >> logcat.log + - name: Run tests try#2 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_1.outcome == 'failure' + id: avd_run_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log - # - name: Run tests try#3 - # uses: reactivecircus/android-emulator-runner@v2 - # if: steps.avd_run_2.outcome == 'failure' - # id: avd_run_3 - # # continue-on-error: true # Fail if even fail the 3rd try - # with: - # working-directory: ${{env.GRADLE_DIR}} - # api-level: ${{ matrix.api-level }} - # target: ${{ env.EMU_TARGET }} - # force-avd-creation: false - # emulator-options: ${{ env.EMU_OPTS }} - # disable-animations: true - # profile: ${{ env.EMU_PROFILE }} - # avd-name: ${{ env.EMU_AVD_NAME }} - # script: | - # adb shell "logcat -b all -v color" & - # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # adb shell "logcat -b all" >> logcat.log - # ## Redundancy End - - # - name: Get Bug Report & tombstones - # if: always() - # run: | - # adb bugreport bugreport.zip + - name: Run tests try#3 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_2.outcome == 'failure' + id: avd_run_3 + # continue-on-error: true # Fail if even fail the 3rd try + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + ## Redundancy End + + - name: Get Bug Report & tombstones + if: always() + run: | + adb bugreport bugreport.zip - # - name: Shutdown PVR ADB-Telnet Server and log - # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - # if: always() - # run: | - # echo "shutdown meow !" >> pvr-adb-telnet.sd - # cat log.txt + - name: Shutdown PVR ADB-Telnet Server and log + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + if: always() + run: | + echo "shutdown meow !" >> pvr-adb-telnet.sd + cat log.txt - # # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - # - uses: actions/upload-artifact@v3 - # if: always() - # with: - # name: Test results - # path: | - # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - # **/app/build/reports - # **/app/build/test-results - # **/app/build/outputs/androidTest-results - # ${{env.GRADLE_DIR}}/logcat.log - # ./*.mov - # bugreport.zip + # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + - uses: actions/upload-artifact@v3 + if: always() + with: + name: Test results + path: | + **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + **/app/build/reports + **/app/build/test-results + **/app/build/outputs/androidTest-results + ${{env.GRADLE_DIR}}/logcat.log + ./*.mov + bugreport.zip - # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - # - name: Publish Test Results in Comment - # uses: EnricoMi/publish-unit-test-result-action/composite@v2 - # # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - # if: always() - # with: - # report_individual_runs: true - # report_suite_logs: 'any' - # deduplicate_classes_by_file_name: true - # comment_title: '🛠 Test Results' - # files: | - # code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml + - name: Publish Test Results in Comment + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + if: always() + with: + report_individual_runs: true + report_suite_logs: 'any' + deduplicate_classes_by_file_name: true + comment_title: '🛠 Test Results' + files: | + code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml - # - uses: iterative/setup-cml@v1 - # if: always() + - uses: iterative/setup-cml@v1 + if: always() - # - name: Publish Screenshots - Find Comment - # if: always() - # uses: peter-evans/find-comment@v2 - # id: fc - # with: - # issue-number: ${{ github.event.number }} - # body-includes: '# 📷 Screenshots of tests:' - # direction: last - # comment-author: 'github-actions[bot]' + - name: Publish Screenshots - Find Comment + if: always() + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.number }} + body-includes: '# 📷 Screenshots of tests:' + direction: last + comment-author: 'github-actions[bot]' - # - name: Publish Screenshots - build comment - # if: always() - # env: - # REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # EVENT: ${{ github.event_name }} - # REF: ${{ github.ref }} - # WK_DIR: ${{env.GRADLE_DIR}} - # shell: bash - # working-directory: ${{env.GRADLE_DIR}} - # run: | - # echo "# 📷 Screenshots of tests:" >> comment.md - # echo "" >> comment.md + - name: Publish Screenshots - build comment + if: always() + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EVENT: ${{ github.event_name }} + REF: ${{ github.ref }} + WK_DIR: ${{env.GRADLE_DIR}} + shell: bash + working-directory: ${{env.GRADLE_DIR}} + run: | + echo "# 📷 Screenshots of tests:" >> comment.md + echo "" >> comment.md - # ls -alh - # ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + ls -alh + ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - # # for each AVD Image - # for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + # for each AVD Image + for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do - # ls -alh "$ss_test_avd" - # echo "$ss_test_avd" - # ss_test_avd_desc=$(basename "$ss_test_avd") + ls -alh "$ss_test_avd" + echo "$ss_test_avd" + ss_test_avd_desc=$(basename "$ss_test_avd") - # echo "" >> comment.md - # echo "### 📱 $ss_test_avd_desc" >> comment.md - # echo "" >> comment.md + echo "" >> comment.md + echo "### 📱 $ss_test_avd_desc" >> comment.md + echo "" >> comment.md - # # for each .png in that AVD folder - # for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do + # for each .png in that AVD folder + for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do - # ss_test_desc=$(basename "$ss_test" .png) + ss_test_desc=$(basename "$ss_test" .png) - # echo "#### 🔧 $ss_test_desc" >> comment.md - - # echo "$WK_DIR/$ss_test" - # echo '

' >> comment.md - # cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md - # echo '

' >> comment.md - - # done - # done - - # if [ "$EVENT" == 'pull_request' ] - # then - # sha=${{ github.event.pull_request.head.sha}} - # elif [ "$EVENT" == 'workflow_run' ] - # then - # sha=${{ github.event.workflow_run.head_sha}} - # else - # sha=$GITHUB_SHA - # fi + echo "#### 🔧 $ss_test_desc" >> comment.md + + echo "$WK_DIR/$ss_test" + echo '

' >> comment.md + cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md + echo '

' >> comment.md + + done + done + + if [ "$EVENT" == 'pull_request' ] + then + sha=${{ github.event.pull_request.head.sha}} + elif [ "$EVENT" == 'workflow_run' ] + then + sha=${{ github.event.workflow_run.head_sha}} + else + sha=$GITHUB_SHA + fi - # echo "" >> comment.md - # echo "###### For commit $sha" >> comment.md + echo "" >> comment.md + echo "###### For commit $sha" >> comment.md - # - name: Publish Screehnshots - Update or Create Comment - # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - # uses: peter-evans/create-or-update-comment@v3 - # with: - # comment-id: ${{ steps.fc.outputs.comment-id }} - # body-file: comment.md - # edit-mode: replace - # issue-number: ${{ github.event.number }} + - name: Publish Screehnshots - Update or Create Comment + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + body-file: comment.md + edit-mode: replace + issue-number: ${{ github.event.number }} - # # - name: Save AVD Cache - # # uses: actions/cache/save@v3 - # # if: always() && !steps.avd-cache.outputs.cache-hit - # # with: - # # path: | - # # ~/.android/avd/* - # # ~/.android/adb* - # # key: avd-${{ matrix.api-level }} - Test_APK_Win: - name: Test APK Win - runs-on: windows-latest - env: - EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio - EMU_PROFILE: pixel_2 - EMU_AVD_NAME: Pixel_2 - EMU_TARGET: google_apis_playstore # google_apis - MATRIX_E_SDK: 30 - MATRIX_AVD: test_win + # - name: Save AVD Cache + # uses: actions/cache/save@v3 + # if: always() && !steps.avd-cache.outputs.cache-hit + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} + # Test_APK_Win: + # name: Test APK Win + # runs-on: windows-latest + # env: + # EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + # EMU_PROFILE: pixel_2 + # EMU_AVD_NAME: Pixel_2 + # EMU_TARGET: google_apis_playstore # google_apis + # MATRIX_E_SDK: 30 + # MATRIX_AVD: test_win - strategy: - matrix: - api-level: [30] # 29 - steps: - - uses: FedericoCarboni/setup-ffmpeg@v2 - id: setup-ffmpeg - - run: | - ffmpeg -f gdigrab -framerate 30 -i desktop -t 120 out_API$SUFFIX.mov & - npm install --global nircmd - nircmd --help - shell: bash + # strategy: + # matrix: + # api-level: [30] # 29 + # steps: + # - uses: FedericoCarboni/setup-ffmpeg@v2 + # id: setup-ffmpeg + # - run: | + # ffmpeg -f gdigrab -framerate 30 -i desktop -t 120 out_API$SUFFIX.mov & + # npm install --global nircmd + # nircmd --help + # shell: bash - - name: Create Android emulator - shell: bash - run: | - # brew install intel-haxm - # Install AVD files + # - name: Create Android emulator + # shell: bash + # run: | + # # brew install intel-haxm + # # Install AVD files - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' > /dev/null - echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses > /dev/null + # echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --install 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' > /dev/null + # echo "y" | $ANDROID_HOME\\tools\\bin\\sdkmanager.bat --licenses > /dev/null - echo Creating emulator - $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' - $ANDROID_HOME\\emulator\\emulator -list-avds - if false; then - emulator_config=~\\.android\\avd\\$MATRIX_AVD.avd\\config.ini - # The following madness is to support empty OR populated config.ini files, - # the state of which is dependant on the version of the emulator used (which we don't control), - # so let's be defensive to be safe. - # Replace existing config (NOTE we're on MacOS so sed works differently!) - # sed -i .bak 's/hw.lcd.density=.*/hw.lcd.density=420/' "$emulator_config" - # sed -i .bak 's/hw.lcd.height=.*/hw.lcd.height=1920/' "$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=420" >> "$emulator_config" - fi - if ! grep -q "hw.lcd.height" "$emulator_config"; then - echo "hw.lcd.height=1920" >> "$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 + # echo Creating emulator + # $ANDROID_HOME\\tools\\bin\\avdmanager.bat create avd -n $MATRIX_AVD -d pixel --package 'system-images;android-'$MATRIX_E_SDK';google_apis_playstore;x86' + # $ANDROID_HOME\\emulator\\emulator -list-avds + # if false; then + # emulator_config=~\\.android\\avd\\$MATRIX_AVD.avd\\config.ini + # # The following madness is to support empty OR populated config.ini files, + # # the state of which is dependant on the version of the emulator used (which we don't control), + # # so let's be defensive to be safe. + # # Replace existing config (NOTE we're on MacOS so sed works differently!) + # # sed -i .bak 's/hw.lcd.density=.*/hw.lcd.density=420/' "$emulator_config" + # # sed -i .bak 's/hw.lcd.height=.*/hw.lcd.height=1920/' "$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=420" >> "$emulator_config" + # fi + # if ! grep -q "hw.lcd.height" "$emulator_config"; then + # echo "hw.lcd.height=1920" >> "$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 - timeout-minutes: 30 # ~4min normal - 3x DOSafety - env: - SUFFIX: ${{ matrix.android_avd }}-eAPI-${{ matrix.android_emu_version }}-${{ matrix.os }} - shell: bash - run: | - echo "Starting emulator and waiting for boot to complete...." - ls -la $ANDROID_HOME\\emulator - nohup $ANDROID_HOME\\tools\\emulator -avd $MATRIX_AVD -gpu swiftshader_indirect -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 + # - name: Start Android emulator + # timeout-minutes: 30 # ~4min normal - 3x DOSafety + # env: + # SUFFIX: ${{ matrix.android_avd }}-eAPI-${{ matrix.android_emu_version }}-${{ matrix.os }} + # shell: bash + # run: | + # echo "Starting emulator and waiting for boot to complete...." + # ls -la $ANDROID_HOME\\emulator + # nohup $ANDROID_HOME\\tools\\emulator -avd $MATRIX_AVD -gpu swiftshader_indirect -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 - nircmd savescreenshot screenshot$SUFFIX.jpg + # nircmd savescreenshot screenshot$SUFFIX.jpg - $ANDROID_HOME\\platform-tools\\adb exec-out screencap -p > emulator$SUFFIX.png + # $ANDROID_HOME\\platform-tools\\adb exec-out screencap -p > emulator$SUFFIX.png - ls -alh + # ls -alh # - name: checkout # uses: actions/checkout@v3 @@ -780,14 +780,14 @@ jobs: # **/app/build/outputs/androidTest-results # ${{env.GRADLE_DIR}}/logcat.log # bugreport.zip - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test results - path: | - .*.mov - .*.png - .*.jpg + # - uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: Test results + # path: | + # .*.mov + # .*.png + # .*.jpg # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml # - name: Publish Test Results in Comment From 39d5d889817a2e17b4b61b3b42f957907941e9f8 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 09:43:35 +0530 Subject: [PATCH 070/107] Update ALVRActivityTest.kt --- .../viritualisres/phonevr/ALVRActivityTest.kt | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt index 17bfe727..97c14c6d 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt @@ -153,7 +153,46 @@ class ALVRActivityTest: PVRInstrumentationBase() { } @SuppressLint("CheckResult") - @Test + // @Test TODO: Fix Crash related to OpenGL on MacOS + // 05-01 07:58:27.665 7493 7493 F DEBUG : backtrace: + // 05-01 07:58:27.666 7493 7493 F DEBUG : #00 pc 00000b99 [vdso] (__kernel_vsyscall+9) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #01 pc 0005ad68 /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #02 pc 00076511 /apex/com.android.runtime/lib/bionic/libc.so (abort+209) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #03 pc 002ff2de /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk (offset 0x150c000) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #04 pc 002ffe01 /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk (offset 0x150c000) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #05 pc 00300d6e /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk (offset 0x150c000) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #06 pc 002904cf /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk (offset 0x150c000) (alvr_render_lobby_opengl+127) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #07 pc 00062920 /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk!libnative-lib.so (offset 0x1e4f000) (Java_viritualisres_phonevr_ALVRActivity_renderNative+3968) (BuildId: 6c0e91c7da5ce75187f221277be2b84bed4be231) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #08 pc 00142132 /apex/com.android.art/lib/libart.so (art_quick_generic_jni_trampoline+82) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.666 7493 7493 F DEBUG : #09 pc 0013b922 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.667 7493 7493 F DEBUG : #10 pc 001d0381 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.667 7493 7493 F DEBUG : #11 pc 00386701 /apex/com.android.art/lib/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+385) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.662 7333 7440 I CardboardSDK: PosePrediction::GetRotationFromGyroscope: Velocity really small, returning identity rotation. + // 05-01 07:58:27.667 5178 7519 I Fitness : OnPackageChangedOperation got intent: Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:com.google.android.gms flg=0x45000010 cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) } [CONTEXT service_id=17 ] + // 05-01 07:58:27.667 7493 7493 F DEBUG : #12 pc 0037aa3e /apex/com.android.art/lib/libart.so (bool art::interpreter::DoCall(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1070) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.667 7493 7493 F DEBUG : #13 pc 007a4179 /apex/com.android.art/lib/libart.so (MterpInvokeDirect+633) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.667 7493 7493 F DEBUG : #14 pc 001358a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_direct+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.667 7493 7493 F DEBUG : #15 pc 0000399c [anon:dalvik-classes3.dex extracted in memory from /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk!classes3.dex] (viritualisres.phonevr.ALVRActivity.access$300) + // 05-01 07:58:27.667 7493 7493 F DEBUG : #16 pc 007a505e /apex/com.android.art/lib/libart.so (MterpInvokeStatic+1454) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #17 pc 00135921 /apex/com.android.art/lib/libart.so (mterp_op_invoke_static+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #18 pc 00003880 [anon:dalvik-classes3.dex extracted in memory from /data/app/~~6OpgdUaw8JphsNXgyGM1Sg==/viritualisres.phonevr-NkgO07jPDvzXvA_dHjnXNA==/base.apk!classes3.dex] (viritualisres.phonevr.ALVRActivity$Renderer.onDrawFrame+4) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #19 pc 007a355e /apex/com.android.art/lib/libart.so (MterpInvokeInterface+2126) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #20 pc 001359a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_interface+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #21 pc 0034a3b4 /system/framework/framework.jar (offset 0x92b000) (android.opengl.GLSurfaceView$GLThread.guardedRun+1092) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #22 pc 007a44ae /apex/com.android.art/lib/libart.so (MterpInvokeDirect+1454) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #23 pc 001358a1 /apex/com.android.art/lib/libart.so (mterp_op_invoke_direct+33) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #24 pc 0034a9ac /system/framework/framework.jar (offset 0x92b000) (android.opengl.GLSurfaceView$GLThread.run+48) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #25 pc 0036fb02 /apex/com.android.art/lib/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.16375758241455872412)+370) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #26 pc 00379b00 /apex/com.android.art/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*)+176) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.668 7493 7493 F DEBUG : #27 pc 0078b325 /apex/com.android.art/lib/libart.so (artQuickToInterpreterBridge+1061) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #28 pc 0014220d /apex/com.android.art/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #29 pc 0013b922 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+338) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #30 pc 001d0381 /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+241) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #31 pc 0062f37c /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+620) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #32 pc 0062f595 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+85) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #33 pc 00697701 /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1537) (BuildId: 8191579dfafff37a5cbca70f9a73020f) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #34 pc 000e6974 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+100) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) + // 05-01 07:58:27.669 7493 7493 F DEBUG : #35 pc 00078567 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) @Throws(IOException::class) fun saveDeviceScreenBitmap() { // SKIP Cardboard API Asking to Scan QR From 341f99a3785ce5908aca23512813a38d12c836b5 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 10:30:03 +0530 Subject: [PATCH 071/107] upd --- .github/workflows/build.yml | 2 +- .../androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f362567c..94afa1ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -301,7 +301,7 @@ jobs: run: | brew install glfw3 brew install glew - brew install glxinfo + # brew install glxinfo # glxinfo | grep -i opengl diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt index 97c14c6d..f8d0f37f 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt @@ -153,7 +153,7 @@ class ALVRActivityTest: PVRInstrumentationBase() { } @SuppressLint("CheckResult") - // @Test TODO: Fix Crash related to OpenGL on MacOS + // @Test TODO: Fix Crash related to OpenGL on MacOS - after pulling upstream changes // 05-01 07:58:27.665 7493 7493 F DEBUG : backtrace: // 05-01 07:58:27.666 7493 7493 F DEBUG : #00 pc 00000b99 [vdso] (__kernel_vsyscall+9) // 05-01 07:58:27.666 7493 7493 F DEBUG : #01 pc 0005ad68 /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) From a87b64542d3bfd56aa55e7b74d511845acc40d5a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 10:39:21 +0530 Subject: [PATCH 072/107] Update build.yml --- .github/workflows/build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94afa1ab..29b7d7f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -364,12 +364,9 @@ jobs: adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log + + adb bugreport bugreport.zip ## Redundancy End - - - name: Get Bug Report & tombstones - if: always() - run: | - adb bugreport bugreport.zip - name: Shutdown PVR ADB-Telnet Server and log working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ From cc71e7dba9fea89742a1880e7a995f285240b613 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 10:39:40 +0530 Subject: [PATCH 073/107] Update build.yml --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29b7d7f3..9a118ea9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -326,6 +326,8 @@ jobs: adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log + + adb bugreport bugreport.zip - name: Run tests try#2 uses: reactivecircus/android-emulator-runner@v2 @@ -345,6 +347,8 @@ jobs: adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log + + adb bugreport bugreport.zip - name: Run tests try#3 uses: reactivecircus/android-emulator-runner@v2 From 34ebfec6cba2462fba5efbb0b2f254b80e232124 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 13:03:36 +0530 Subject: [PATCH 074/107] upd --- .github/workflows/build.yml | 5 +++-- .../java/viritualisres/phonevr/ALVRActivityTest.kt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a118ea9..a602fdcb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -347,7 +347,7 @@ jobs: adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log - + adb bugreport bugreport.zip - name: Run tests try#3 @@ -391,7 +391,7 @@ jobs: **/app/build/outputs/androidTest-results ${{env.GRADLE_DIR}}/logcat.log ./*.mov - bugreport.zip + ${{env.GRADLE_DIR}}/bugreport.zip # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - name: Publish Test Results in Comment @@ -434,6 +434,7 @@ jobs: ls -alh ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + stat 'code/mobile/android/PhoneVR/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do diff --git a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt index f8d0f37f..7f01b659 100644 --- a/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt +++ b/code/mobile/android/PhoneVR/app/src/androidTest/java/viritualisres/phonevr/ALVRActivityTest.kt @@ -38,7 +38,7 @@ import java.lang.Thread.sleep * or * build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2_API_30(AVD) - 11 */ -@RunWith(AndroidJUnit4::class) +// @RunWith(AndroidJUnit4::class) class ALVRActivityTest: PVRInstrumentationBase() { private val TAG: String? = javaClass.simpleName @@ -153,7 +153,7 @@ class ALVRActivityTest: PVRInstrumentationBase() { } @SuppressLint("CheckResult") - // @Test TODO: Fix Crash related to OpenGL on MacOS - after pulling upstream changes + // @Test TODO: Fix Crash related to OpenGL on MacOS - after pulling upstream changes (for extra info, bug in alvr_client_core's frames) // 05-01 07:58:27.665 7493 7493 F DEBUG : backtrace: // 05-01 07:58:27.666 7493 7493 F DEBUG : #00 pc 00000b99 [vdso] (__kernel_vsyscall+9) // 05-01 07:58:27.666 7493 7493 F DEBUG : #01 pc 0005ad68 /apex/com.android.runtime/lib/bionic/libc.so (syscall+40) (BuildId: 6e3a0180fa6637b68c0d181c343e6806) From 340c2b9a1e29d44edb455cc3edec0c662c5b139a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 2 May 2023 14:43:52 +0530 Subject: [PATCH 075/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a602fdcb..ae1c4cdb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -454,9 +454,9 @@ jobs: echo "#### 🔧 $ss_test_desc" >> comment.md - echo "$WK_DIR/$ss_test" + echo "$WK_DIR + / + $ss_test" echo '

' >> comment.md - cml-publish "$WK_DIR/$ss_test" | sed -E 's/.+//' >> comment.md + cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md echo '

' >> comment.md done From a41c90260be1e9df2ff9b19858cf644eecfb8c9f Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 17:16:39 +0530 Subject: [PATCH 076/107] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae1c4cdb..132d35d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -369,7 +369,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log - adb bugreport bugreport.zip + # adb bugreport bugreport.zip # hangs indef here ## Redundancy End - name: Shutdown PVR ADB-Telnet Server and log @@ -434,7 +434,7 @@ jobs: ls -alh ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - stat 'code/mobile/android/PhoneVR/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' + stat 'app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do From 9c8fb25e95f3b1903d3076979385bf514509ff26 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 18:43:57 +0530 Subject: [PATCH 077/107] Update build.yml --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 132d35d7..a4fe247f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -327,7 +327,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log - adb bugreport bugreport.zip + # adb bugreport bugreport.zip # hangs indef here - name: Run tests try#2 uses: reactivecircus/android-emulator-runner@v2 @@ -348,7 +348,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb shell "logcat -b all" >> logcat.log - adb bugreport bugreport.zip + # adb bugreport bugreport.zip # hangs indef here - name: Run tests try#3 uses: reactivecircus/android-emulator-runner@v2 @@ -406,6 +406,11 @@ jobs: files: | code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + # https://github.com/iterative/cml/issues/1377 + - uses: actions/setup-node@v1 + with: + node-version: '16' + - uses: iterative/setup-cml@v1 if: always() From 674b3ea806684830fe4f644ea319f3b9e6c5e4d2 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 18:50:21 +0530 Subject: [PATCH 078/107] Update build.yml --- .github/workflows/build.yml | 337 ++++++++++++++++++++++++++++++++++++ 1 file changed, 337 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4fe247f..6a22d33d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -489,6 +489,343 @@ jobs: edit-mode: replace issue-number: ${{ github.event.number }} + # - name: Save AVD Cache + # uses: actions/cache/save@v3 + # if: always() && !steps.avd-cache.outputs.cache-hit + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} + Test_APK_Linux: + name: Test APK Linux + runs-on: ubuntu-latest + env: + EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + EMU_PROFILE: pixel_2 + EMU_AVD_NAME: Pixel_2 + EMU_TARGET: playstore # google_apis + + strategy: + matrix: + api-level: [30] # 29 + steps: + - name: checkout + uses: actions/checkout@v3 + with: + submodules: 'true' + + - name: Set Up JDK + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: 17 + + # Only for Testing github-actions + - uses: actions-rs/toolchain@v1 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: Swatinem/rust-cache@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + cache-on-failure: true + workspaces: ${{env.GRADLE_DIR}}/ALVR/ + + - uses: gradle/gradle-build-action@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + build-root-directory: ${{env.GRADLE_DIR}} + cache-read-only: ${{ false }} + + # - name: AVD cache + # uses: actions/cache@v3 + # id: avd-cache + # with: + # path: | + # ~/.android/avd/* + # ~/.android/adb* + # key: avd-${{ matrix.api-level }} + + ## Create AVD with some redundancy - 3 Checks + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + + - name: create AVD and generate snapshot for caching try#2 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + + - name: create AVD and generate snapshot for caching try#3 + if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + id: avd_create_3 + # continue-on-error: true # Fail if even fail the 3rd try + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: false + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: echo "Generated AVD snapshot for caching." + ## Redundancy End + + - name: Prepare deps + shell: bash + run: | + ls -alh + cd code/mobile/android/PhoneVR + chmod +x prepare-alvr-deps.sh + bash prepare-alvr-deps.sh + + - name: Change gradle wrapper permissions + run: | + echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs + cat ~/.android/advancedFeatures.ini + + cd code/mobile/android/PhoneVR + chmod +x ./gradlew + ls -alh + ls -alh app + + # Cache APK gradle tasks + - name: Build apk debug project (APK) + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + + - name: Start PVR ADB-Telnet Server + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + run: | + brew install telnet + + chmod +x pvr-adb-telnet.sh + bash pvr-adb-telnet.sh >> log.txt 2>&1 & + + - name: Install recorder and record session + env: + SUFFIX: ${{ matrix.api-level }} + run: | + brew install glfw3 + brew install glew + # brew install glxinfo + + # glxinfo | grep -i opengl + + brew install ffmpeg + ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + + ## Create AVD with some redundancy - 3 Checks + - name: Run tests + uses: reactivecircus/android-emulator-runner@v2 + id: avd_run_1 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + + # adb bugreport bugreport.zip # hangs indef here + + - name: Run tests try#2 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_1.outcome == 'failure' + id: avd_run_2 + continue-on-error: true + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + + # adb bugreport bugreport.zip # hangs indef here + + - name: Run tests try#3 + uses: reactivecircus/android-emulator-runner@v2 + if: steps.avd_run_2.outcome == 'failure' + id: avd_run_3 + # continue-on-error: true # Fail if even fail the 3rd try + with: + working-directory: ${{env.GRADLE_DIR}} + api-level: ${{ matrix.api-level }} + target: ${{ env.EMU_TARGET }} + force-avd-creation: false + emulator-options: ${{ env.EMU_OPTS }} + disable-animations: true + profile: ${{ env.EMU_PROFILE }} + avd-name: ${{ env.EMU_AVD_NAME }} + script: | + adb shell "logcat -b all -v color" & + ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + adb shell "logcat -b all" >> logcat.log + + # adb bugreport bugreport.zip # hangs indef here + ## Redundancy End + + - name: Shutdown PVR ADB-Telnet Server and log + working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + if: always() + run: | + echo "shutdown meow !" >> pvr-adb-telnet.sd + cat log.txt + + # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + - uses: actions/upload-artifact@v3 + if: always() + with: + name: Test results + path: | + **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + **/app/build/reports + **/app/build/test-results + **/app/build/outputs/androidTest-results + ${{env.GRADLE_DIR}}/logcat.log + ./*.mov + ${{env.GRADLE_DIR}}/bugreport.zip + + # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml + - name: Publish Test Results in Comment + uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + if: always() + with: + report_individual_runs: true + report_suite_logs: 'any' + deduplicate_classes_by_file_name: true + comment_title: '🛠 Test Results' + files: | + code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + + # https://github.com/iterative/cml/issues/1377 + - uses: actions/setup-node@v1 + with: + node-version: '16' + + - uses: iterative/setup-cml@v1 + if: always() + + - name: Publish Screenshots - Find Comment + if: always() + uses: peter-evans/find-comment@v2 + id: fc + with: + issue-number: ${{ github.event.number }} + body-includes: '# 📷 Screenshots of tests:' + direction: last + comment-author: 'github-actions[bot]' + + - name: Publish Screenshots - build comment + if: always() + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + EVENT: ${{ github.event_name }} + REF: ${{ github.ref }} + WK_DIR: ${{env.GRADLE_DIR}} + shell: bash + working-directory: ${{env.GRADLE_DIR}} + run: | + echo "# 📷 Screenshots of tests:" >> comment.md + echo "" >> comment.md + + ls -alh + ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + stat 'app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' + + # for each AVD Image + for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + + ls -alh "$ss_test_avd" + echo "$ss_test_avd" + ss_test_avd_desc=$(basename "$ss_test_avd") + + echo "" >> comment.md + echo "### 📱 $ss_test_avd_desc" >> comment.md + echo "" >> comment.md + + # for each .png in that AVD folder + for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do + + ss_test_desc=$(basename "$ss_test" .png) + + echo "#### 🔧 $ss_test_desc" >> comment.md + + echo "$WK_DIR + / + $ss_test" + echo '

' >> comment.md + cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md + echo '

' >> comment.md + + done + done + + if [ "$EVENT" == 'pull_request' ] + then + sha=${{ github.event.pull_request.head.sha}} + elif [ "$EVENT" == 'workflow_run' ] + then + sha=${{ github.event.workflow_run.head_sha}} + else + sha=$GITHUB_SHA + fi + + echo "" >> comment.md + echo "###### For commit $sha" >> comment.md + + - name: Publish Screehnshots - Update or Create Comment + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + body-file: comment.md + edit-mode: replace + issue-number: ${{ github.event.number }} + # - name: Save AVD Cache # uses: actions/cache/save@v3 # if: always() && !steps.avd-cache.outputs.cache-hit From 3f5704bd0f5539abb03d5d726c89ec183a5f93a7 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 19:22:35 +0530 Subject: [PATCH 079/107] Update build.yml --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a22d33d..a4b3eee1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -834,6 +834,15 @@ jobs: # ~/.android/avd/* # ~/.android/adb* # key: avd-${{ matrix.api-level }} + Test_APK_Win: + runs-on: windows-latest + steps: + - name: Test HyperV + shell: powershell + run: | + Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V + get-service | findstr vmcompute + # Test_APK_Win: # name: Test APK Win # runs-on: windows-latest From 323b2ac89a6fc98d4d06d7567eba33861e7bddb8 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 19:48:15 +0530 Subject: [PATCH 080/107] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4b3eee1..0ef1a00a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -842,6 +842,7 @@ jobs: run: | Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V get-service | findstr vmcompute + $ANDROID_HOME\\emulator\\emulator -accel-check # Test_APK_Win: # name: Test APK Win From ea5ca03a914e10825da290497c936be24a7648ef Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 19:49:11 +0530 Subject: [PATCH 081/107] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0ef1a00a..9716c564 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -842,7 +842,7 @@ jobs: run: | Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V get-service | findstr vmcompute - $ANDROID_HOME\\emulator\\emulator -accel-check + $ANDROID_HOME\emulator\emulator -accel-check # Test_APK_Win: # name: Test APK Win From 24c74756dbb603a820345f7dd839c392f4d7005e Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 19:56:17 +0530 Subject: [PATCH 082/107] Update build.yml --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9716c564..337dcd71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -842,7 +842,11 @@ jobs: run: | Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V get-service | findstr vmcompute - $ANDROID_HOME\emulator\emulator -accel-check + + - name: Test emu + shell: bash + run: | + $ANDROID_HOME\\emulator\\emulator -accel-check # Test_APK_Win: # name: Test APK Win From 0ab5005f21f8eeeb66597ed5c2bfb25042b3323b Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:09:52 +0530 Subject: [PATCH 083/107] Create .cirrus.yml --- .cirrus.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..8e509621 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,5 @@ +assemble_task: + container: + image: reactivecircus/android-sdk:latest + assemble_script: + ./gradlew assembleDebug \ No newline at end of file From 120f9f0cc0bb288908556c4af5e089756e87876a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:13:31 +0530 Subject: [PATCH 084/107] Update .cirrus.yml --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8e509621..06262973 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,4 +2,4 @@ assemble_task: container: image: reactivecircus/android-sdk:latest assemble_script: - ./gradlew assembleDebug \ No newline at end of file + ./code/mobile/android/PhoneVR/gradlew assembleDebug \ No newline at end of file From 623f4ad2ea248f2ed4f6c30f1038d4718e7c5c55 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:14:21 +0530 Subject: [PATCH 085/107] Update .cirrus.yml --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 06262973..6a6c223a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,4 +2,5 @@ assemble_task: container: image: reactivecircus/android-sdk:latest assemble_script: + chmod +x ./code/mobile/android/PhoneVR/gradlew ./code/mobile/android/PhoneVR/gradlew assembleDebug \ No newline at end of file From b9a42ba0da0bc6de391ea4473316be955b6da3bf Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:15:48 +0530 Subject: [PATCH 086/107] Update .cirrus.yml --- .cirrus.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.cirrus.yml b/.cirrus.yml index 6a6c223a..059f2331 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,4 +3,5 @@ assemble_task: image: reactivecircus/android-sdk:latest assemble_script: chmod +x ./code/mobile/android/PhoneVR/gradlew + ./code/mobile/android/PhoneVR/gradlew assembleDebug \ No newline at end of file From e0a2a88a0a746c58fbc11430114b5f304e085a0a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:21:55 +0530 Subject: [PATCH 087/107] Update .cirrus.yml --- .cirrus.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 059f2331..19ebd8af 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,7 +1,8 @@ +windows_container: + image: cirrusci/windowsservercore:2019 + assemble_task: container: - image: reactivecircus/android-sdk:latest + image: reactivecircus/android-emulator-30:latest assemble_script: - chmod +x ./code/mobile/android/PhoneVR/gradlew - - ./code/mobile/android/PhoneVR/gradlew assembleDebug \ No newline at end of file + emulator -accel-check \ No newline at end of file From 56ec2640a160c3bc2bcc6a89dee67a6234e3870a Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:26:19 +0530 Subject: [PATCH 088/107] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 337dcd71..ebe557df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -325,7 +325,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + adb logcat -b all > logcat.log # adb bugreport bugreport.zip # hangs indef here @@ -346,7 +346,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + adb logcat -b all > logcat.log # adb bugreport bugreport.zip # hangs indef here @@ -367,7 +367,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + adb logcat -b all > logcat.log # adb bugreport bugreport.zip # hangs indef here ## Redundancy End From 589f7488042e515a61fb2f5b23feec3e7f02ab27 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:29:47 +0530 Subject: [PATCH 089/107] Update .cirrus.yml --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 19ebd8af..f943f780 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,4 +5,4 @@ assemble_task: container: image: reactivecircus/android-emulator-30:latest assemble_script: - emulator -accel-check \ No newline at end of file + $ANDROID_HOME/emulator/emulator -accel-check \ No newline at end of file From a32aacd92cb6ce5e9c9f2404aefbd2647c83d292 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:30:18 +0530 Subject: [PATCH 090/107] Update .cirrus.yml --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f943f780..064e4aab 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,5 @@ -windows_container: - image: cirrusci/windowsservercore:2019 +# windows_container: +# image: cirrusci/windowsservercore:2019 assemble_task: container: From 061f36e0cbca553f9e6c4ef402b3e1dc1b13ee11 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:32:35 +0530 Subject: [PATCH 091/107] Update .cirrus.yml --- .cirrus.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 064e4aab..0716960b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,19 @@ # image: cirrusci/windowsservercore:2019 assemble_task: + env: + API_LEVEL: 28 + TARGET: default + ARCH: x86_64 container: - image: reactivecircus/android-emulator-30:latest + image: reactivecircus/android-emulator-28:latest + kvm: true + cpu: 8 + memory: 24G + # create_device_script: + # echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" + # start_emulator_background_script: + # $ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none + # wait_for_emulator_script: assemble_script: $ANDROID_HOME/emulator/emulator -accel-check \ No newline at end of file From f6898db3bef757aa405b61df00df16b31c53367f Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:35:30 +0530 Subject: [PATCH 092/107] Update .cirrus.yml --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0716960b..d8058ded 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,8 +11,8 @@ assemble_task: kvm: true cpu: 8 memory: 24G - # create_device_script: - # echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" + create_device_script: + echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" # start_emulator_background_script: # $ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none # wait_for_emulator_script: From 7fa260a703f68ca6283aa6a2816acbf7d2e16b44 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:40:33 +0530 Subject: [PATCH 093/107] Update .cirrus.yml --- .cirrus.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d8058ded..530bfd10 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,11 +3,11 @@ assemble_task: env: - API_LEVEL: 28 - TARGET: default + API_LEVEL: 30 + TARGET: google_apis_playstore ARCH: x86_64 container: - image: reactivecircus/android-emulator-28:latest + image: reactivecircus/android-emulator-30:latest kvm: true cpu: 8 memory: 24G From e3ed75532bacc8a8395c081e96db89e74ff248bc Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:43:38 +0530 Subject: [PATCH 094/107] Update .cirrus.yml --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 530bfd10..310b9a53 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,8 +4,8 @@ assemble_task: env: API_LEVEL: 30 - TARGET: google_apis_playstore - ARCH: x86_64 + TARGET: google_apis + ARCH: x86 container: image: reactivecircus/android-emulator-30:latest kvm: true From fb5375f9c3cc4edee391b12595d09da5ecc8a0db Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 20:49:36 +0530 Subject: [PATCH 095/107] Update .cirrus.yml --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 310b9a53..f8157b15 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -17,4 +17,4 @@ assemble_task: # $ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none # wait_for_emulator_script: assemble_script: - $ANDROID_HOME/emulator/emulator -accel-check \ No newline at end of file + emulator -accel-check \ No newline at end of file From f8113ac5c7bad79021695ac2577bc532a913943b Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 21:41:24 +0530 Subject: [PATCH 096/107] Update build.yml --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebe557df..abcce11d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -326,7 +326,8 @@ jobs: adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb logcat -b all > logcat.log - + + jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here - name: Run tests try#2 @@ -348,6 +349,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb logcat -b all > logcat.log + jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here - name: Run tests try#3 @@ -369,6 +371,7 @@ jobs: ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} adb logcat -b all > logcat.log + jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here ## Redundancy End From d3cb551782e0db6998a899592ce3dbe9a339a08b Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 21:42:07 +0530 Subject: [PATCH 097/107] Update build.yml --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abcce11d..fd7f1687 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -184,6 +184,11 @@ jobs: distribution: 'oracle' java-version: 17 + # https://github.com/iterative/cml/issues/1377 + - uses: actions/setup-node@v1 + with: + node-version: '16' + # Only for Testing github-actions - uses: actions-rs/toolchain@v1 if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo @@ -409,11 +414,6 @@ jobs: files: | code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml - # https://github.com/iterative/cml/issues/1377 - - uses: actions/setup-node@v1 - with: - node-version: '16' - - uses: iterative/setup-cml@v1 if: always() From 1e99b46a1e4b4eed7c2a253acfc565aa75e4feee Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Mon, 8 May 2023 22:22:00 +0530 Subject: [PATCH 098/107] Update build.yml --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd7f1687..3c3f4a5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -330,7 +330,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb logcat -b all > logcat.log + # adb logcat -b all > logcat.log jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here @@ -352,7 +352,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb logcat -b all > logcat.log + # adb logcat -b all > logcat.log jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here @@ -374,7 +374,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb logcat -b all > logcat.log + # adb logcat -b all > logcat.log jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here @@ -488,7 +488,7 @@ jobs: uses: peter-evans/create-or-update-comment@v3 with: comment-id: ${{ steps.fc.outputs.comment-id }} - body-file: comment.md + body-file: ${{env.GRADLE_DIR}}/comment.md edit-mode: replace issue-number: ${{ github.event.number }} From 68ed267228b234f7906df1d4494730de50ba4060 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 08:12:44 +0530 Subject: [PATCH 099/107] Update build.yml --- .github/workflows/build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c3f4a5a..96d6e44b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -330,8 +330,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # adb logcat -b all > logcat.log - + # adb logcat -b all > logcat.log jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here @@ -353,7 +352,6 @@ jobs: adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} # adb logcat -b all > logcat.log - jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here @@ -374,8 +372,7 @@ jobs: script: | adb shell "logcat -b all -v color" & ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # adb logcat -b all > logcat.log - + # adb logcat -b all > logcat.log jobs -p | xargs kill # adb bugreport bugreport.zip # hangs indef here ## Redundancy End From 21129cfb796999ee63360499d75d90c02c0063e7 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 09:27:08 +0530 Subject: [PATCH 100/107] Update build.yml --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96d6e44b..33f7ca64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -434,6 +434,8 @@ jobs: shell: bash working-directory: ${{env.GRADLE_DIR}} run: | + brew install gnu-sed # There are differences between default sed on MacOS and Linux (gnuSed) + echo "# 📷 Screenshots of tests:" >> comment.md echo "" >> comment.md @@ -461,7 +463,7 @@ jobs: echo "$WK_DIR + / + $ss_test" echo '

' >> comment.md - cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md + cml-publish "$ss_test" | gsed -E 's/.+//' >> comment.md echo '

' >> comment.md done From 8a636217aa2cfae3ac5b34217455654ec504a8cd Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 09:50:08 +0530 Subject: [PATCH 101/107] Update build.yml --- .github/workflows/build.yml | 622 ++++++++++++++++++------------------ 1 file changed, 311 insertions(+), 311 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33f7ca64..5c251d9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -499,356 +499,356 @@ jobs: # ~/.android/avd/* # ~/.android/adb* # key: avd-${{ matrix.api-level }} - Test_APK_Linux: - name: Test APK Linux - runs-on: ubuntu-latest - env: - EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio - EMU_PROFILE: pixel_2 - EMU_AVD_NAME: Pixel_2 - EMU_TARGET: playstore # google_apis + # Test_APK_Linux: + # name: Test APK Linux + # runs-on: ubuntu-latest + # env: + # EMU_OPTS: -no-window -gpu swiftshader_indirect -no-boot-anim -verbose -camera-back virtualscene # -noaudio + # EMU_PROFILE: pixel_2 + # EMU_AVD_NAME: Pixel_2 + # EMU_TARGET: playstore # google_apis - strategy: - matrix: - api-level: [30] # 29 - steps: - - name: checkout - uses: actions/checkout@v3 - with: - submodules: 'true' + # strategy: + # matrix: + # api-level: [30] # 29 + # steps: + # - name: checkout + # uses: actions/checkout@v3 + # with: + # submodules: 'true' - - name: Set Up JDK - uses: actions/setup-java@v3 - with: - distribution: 'oracle' - java-version: 17 + # - name: Set Up JDK + # uses: actions/setup-java@v3 + # with: + # distribution: 'oracle' + # java-version: 17 - # Only for Testing github-actions - - uses: actions-rs/toolchain@v1 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - uses: Swatinem/rust-cache@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - cache-on-failure: true - workspaces: ${{env.GRADLE_DIR}}/ALVR/ + # # Only for Testing github-actions + # - uses: actions-rs/toolchain@v1 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # profile: minimal + # toolchain: stable + # override: true + # components: clippy + # - uses: Swatinem/rust-cache@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # cache-on-failure: true + # workspaces: ${{env.GRADLE_DIR}}/ALVR/ - - uses: gradle/gradle-build-action@v2 - if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - with: - build-root-directory: ${{env.GRADLE_DIR}} - cache-read-only: ${{ false }} + # - uses: gradle/gradle-build-action@v2 + # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + # with: + # build-root-directory: ${{env.GRADLE_DIR}} + # cache-read-only: ${{ false }} - # - name: AVD cache - # uses: actions/cache@v3 - # id: avd-cache - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} + # # - name: AVD cache + # # uses: actions/cache@v3 + # # id: avd-cache + # # with: + # # path: | + # # ~/.android/avd/* + # # ~/.android/adb* + # # key: avd-${{ matrix.api-level }} - ## Create AVD with some redundancy - 3 Checks - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_1 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." + # ## Create AVD with some redundancy - 3 Checks + # - name: create AVD and generate snapshot for caching + # if: steps.avd-cache.outputs.cache-hit != 'true' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_1 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." - - name: create AVD and generate snapshot for caching try#2 - if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_2 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." + # - name: create AVD and generate snapshot for caching try#2 + # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_1.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_2 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." - - name: create AVD and generate snapshot for caching try#3 - if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - id: avd_create_3 - # continue-on-error: true # Fail if even fail the 3rd try - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: false - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: echo "Generated AVD snapshot for caching." - ## Redundancy End + # - name: create AVD and generate snapshot for caching try#3 + # if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_create_3 + # # continue-on-error: true # Fail if even fail the 3rd try + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: false + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: echo "Generated AVD snapshot for caching." + # ## Redundancy End - - name: Prepare deps - shell: bash - run: | - ls -alh - cd code/mobile/android/PhoneVR - chmod +x prepare-alvr-deps.sh - bash prepare-alvr-deps.sh + # - name: Prepare deps + # shell: bash + # run: | + # ls -alh + # cd code/mobile/android/PhoneVR + # chmod +x prepare-alvr-deps.sh + # bash prepare-alvr-deps.sh - - name: Change gradle wrapper permissions - run: | - echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs - cat ~/.android/advancedFeatures.ini + # - name: Change gradle wrapper permissions + # run: | + # echo "GLESDynamicVersion = on" >> ~/.android/advancedFeatures.ini # OpenGL3 Support on AVDs + # cat ~/.android/advancedFeatures.ini - cd code/mobile/android/PhoneVR - chmod +x ./gradlew - ls -alh - ls -alh app + # cd code/mobile/android/PhoneVR + # chmod +x ./gradlew + # ls -alh + # ls -alh app - # Cache APK gradle tasks - - name: Build apk debug project (APK) - run: | - cd code/mobile/android/PhoneVR - ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # # Cache APK gradle tasks + # - name: Build apk debug project (APK) + # run: | + # cd code/mobile/android/PhoneVR + # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - - name: Start PVR ADB-Telnet Server - working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - run: | - brew install telnet + # - name: Start PVR ADB-Telnet Server + # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + # run: | + # brew install telnet - chmod +x pvr-adb-telnet.sh - bash pvr-adb-telnet.sh >> log.txt 2>&1 & + # chmod +x pvr-adb-telnet.sh + # bash pvr-adb-telnet.sh >> log.txt 2>&1 & - - name: Install recorder and record session - env: - SUFFIX: ${{ matrix.api-level }} - run: | - brew install glfw3 - brew install glew - # brew install glxinfo + # - name: Install recorder and record session + # env: + # SUFFIX: ${{ matrix.api-level }} + # run: | + # brew install glfw3 + # brew install glew + # # brew install glxinfo - # glxinfo | grep -i opengl + # # glxinfo | grep -i opengl - brew install ffmpeg - ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & + # brew install ffmpeg + # ffmpeg -f avfoundation -i 0 -t 840 out_API$SUFFIX.mov & - ## Create AVD with some redundancy - 3 Checks - - name: Run tests - uses: reactivecircus/android-emulator-runner@v2 - id: avd_run_1 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log - - # adb bugreport bugreport.zip # hangs indef here + # ## Create AVD with some redundancy - 3 Checks + # - name: Run tests + # uses: reactivecircus/android-emulator-runner@v2 + # id: avd_run_1 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log + + # # adb bugreport bugreport.zip # hangs indef here - - name: Run tests try#2 - uses: reactivecircus/android-emulator-runner@v2 - if: steps.avd_run_1.outcome == 'failure' - id: avd_run_2 - continue-on-error: true - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log - - # adb bugreport bugreport.zip # hangs indef here + # - name: Run tests try#2 + # uses: reactivecircus/android-emulator-runner@v2 + # if: steps.avd_run_1.outcome == 'failure' + # id: avd_run_2 + # continue-on-error: true + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log + + # # adb bugreport bugreport.zip # hangs indef here - - name: Run tests try#3 - uses: reactivecircus/android-emulator-runner@v2 - if: steps.avd_run_2.outcome == 'failure' - id: avd_run_3 - # continue-on-error: true # Fail if even fail the 3rd try - with: - working-directory: ${{env.GRADLE_DIR}} - api-level: ${{ matrix.api-level }} - target: ${{ env.EMU_TARGET }} - force-avd-creation: false - emulator-options: ${{ env.EMU_OPTS }} - disable-animations: true - profile: ${{ env.EMU_PROFILE }} - avd-name: ${{ env.EMU_AVD_NAME }} - script: | - adb shell "logcat -b all -v color" & - ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - adb shell "logcat -b all" >> logcat.log + # - name: Run tests try#3 + # uses: reactivecircus/android-emulator-runner@v2 + # if: steps.avd_run_2.outcome == 'failure' + # id: avd_run_3 + # # continue-on-error: true # Fail if even fail the 3rd try + # with: + # working-directory: ${{env.GRADLE_DIR}} + # api-level: ${{ matrix.api-level }} + # target: ${{ env.EMU_TARGET }} + # force-avd-creation: false + # emulator-options: ${{ env.EMU_OPTS }} + # disable-animations: true + # profile: ${{ env.EMU_PROFILE }} + # avd-name: ${{ env.EMU_AVD_NAME }} + # script: | + # adb shell "logcat -b all -v color" & + # ./gradlew connectedCheck --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # adb shell "logcat -b all" >> logcat.log - # adb bugreport bugreport.zip # hangs indef here - ## Redundancy End + # # adb bugreport bugreport.zip # hangs indef here + # ## Redundancy End - - name: Shutdown PVR ADB-Telnet Server and log - working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ - if: always() - run: | - echo "shutdown meow !" >> pvr-adb-telnet.sd - cat log.txt + # - name: Shutdown PVR ADB-Telnet Server and log + # working-directory: ${{env.GRADLE_DIR}}/app/src/androidTest/java/viritualisres/phonevr/utils/ + # if: always() + # run: | + # echo "shutdown meow !" >> pvr-adb-telnet.sd + # cat log.txt - # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test results - path: | - **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* - **/app/build/reports - **/app/build/test-results - **/app/build/outputs/androidTest-results - ${{env.GRADLE_DIR}}/logcat.log - ./*.mov - ${{env.GRADLE_DIR}}/bugreport.zip + # # build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/GPlay_Pixel_2_API_30(AVD) - 11/ALVRActivityTest_saveDeviceScreenBitmap.png + # - uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: Test results + # path: | + # **/app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/* + # **/app/build/reports + # **/app/build/test-results + # **/app/build/outputs/androidTest-results + # ${{env.GRADLE_DIR}}/logcat.log + # ./*.mov + # ${{env.GRADLE_DIR}}/bugreport.zip - # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml - - name: Publish Test Results in Comment - uses: EnricoMi/publish-unit-test-result-action/composite@v2 - # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - if: always() - with: - report_individual_runs: true - report_suite_logs: 'any' - deduplicate_classes_by_file_name: true - comment_title: '🛠 Test Results' - files: | - code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml + # # app\build\outputs\androidTest-results\connected\TEST-GPlay_Pixel_2_API_30(AVD) - 11-_app-.xml + # - name: Publish Test Results in Comment + # uses: EnricoMi/publish-unit-test-result-action/composite@v2 + # # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + # if: always() + # with: + # report_individual_runs: true + # report_suite_logs: 'any' + # deduplicate_classes_by_file_name: true + # comment_title: '🛠 Test Results' + # files: | + # code/mobile/android/PhoneVR/app/build/outputs/androidTest-results/**/TEST-*.xml - # https://github.com/iterative/cml/issues/1377 - - uses: actions/setup-node@v1 - with: - node-version: '16' + # # https://github.com/iterative/cml/issues/1377 + # - uses: actions/setup-node@v1 + # with: + # node-version: '16' - - uses: iterative/setup-cml@v1 - if: always() + # - uses: iterative/setup-cml@v1 + # if: always() - - name: Publish Screenshots - Find Comment - if: always() - uses: peter-evans/find-comment@v2 - id: fc - with: - issue-number: ${{ github.event.number }} - body-includes: '# 📷 Screenshots of tests:' - direction: last - comment-author: 'github-actions[bot]' + # - name: Publish Screenshots - Find Comment + # if: always() + # uses: peter-evans/find-comment@v2 + # id: fc + # with: + # issue-number: ${{ github.event.number }} + # body-includes: '# 📷 Screenshots of tests:' + # direction: last + # comment-author: 'github-actions[bot]' - - name: Publish Screenshots - build comment - if: always() - env: - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - EVENT: ${{ github.event_name }} - REF: ${{ github.ref }} - WK_DIR: ${{env.GRADLE_DIR}} - shell: bash - working-directory: ${{env.GRADLE_DIR}} - run: | - echo "# 📷 Screenshots of tests:" >> comment.md - echo "" >> comment.md + # - name: Publish Screenshots - build comment + # if: always() + # env: + # REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # EVENT: ${{ github.event_name }} + # REF: ${{ github.ref }} + # WK_DIR: ${{env.GRADLE_DIR}} + # shell: bash + # working-directory: ${{env.GRADLE_DIR}} + # run: | + # echo "# 📷 Screenshots of tests:" >> comment.md + # echo "" >> comment.md - ls -alh - ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - stat 'app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' + # ls -alh + # ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + # stat 'app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' - # for each AVD Image - for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do + # # for each AVD Image + # for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do - ls -alh "$ss_test_avd" - echo "$ss_test_avd" - ss_test_avd_desc=$(basename "$ss_test_avd") + # ls -alh "$ss_test_avd" + # echo "$ss_test_avd" + # ss_test_avd_desc=$(basename "$ss_test_avd") - echo "" >> comment.md - echo "### 📱 $ss_test_avd_desc" >> comment.md - echo "" >> comment.md + # echo "" >> comment.md + # echo "### 📱 $ss_test_avd_desc" >> comment.md + # echo "" >> comment.md - # for each .png in that AVD folder - for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do + # # for each .png in that AVD folder + # for ss_test in "app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/$ss_test_avd_desc/"*.png; do - ss_test_desc=$(basename "$ss_test" .png) + # ss_test_desc=$(basename "$ss_test" .png) - echo "#### 🔧 $ss_test_desc" >> comment.md - - echo "$WK_DIR + / + $ss_test" - echo '

' >> comment.md - cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md - echo '

' >> comment.md - - done - done - - if [ "$EVENT" == 'pull_request' ] - then - sha=${{ github.event.pull_request.head.sha}} - elif [ "$EVENT" == 'workflow_run' ] - then - sha=${{ github.event.workflow_run.head_sha}} - else - sha=$GITHUB_SHA - fi + # echo "#### 🔧 $ss_test_desc" >> comment.md + + # echo "$WK_DIR + / + $ss_test" + # echo '

' >> comment.md + # cml-publish "$ss_test" | sed -E 's/.+//' >> comment.md + # echo '

' >> comment.md + + # done + # done + + # if [ "$EVENT" == 'pull_request' ] + # then + # sha=${{ github.event.pull_request.head.sha}} + # elif [ "$EVENT" == 'workflow_run' ] + # then + # sha=${{ github.event.workflow_run.head_sha}} + # else + # sha=$GITHUB_SHA + # fi - echo "" >> comment.md - echo "###### For commit $sha" >> comment.md + # echo "" >> comment.md + # echo "###### For commit $sha" >> comment.md - - name: Publish Screehnshots - Update or Create Comment - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() - uses: peter-evans/create-or-update-comment@v3 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - body-file: comment.md - edit-mode: replace - issue-number: ${{ github.event.number }} + # - name: Publish Screehnshots - Update or Create Comment + # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && always() + # uses: peter-evans/create-or-update-comment@v3 + # with: + # comment-id: ${{ steps.fc.outputs.comment-id }} + # body-file: comment.md + # edit-mode: replace + # issue-number: ${{ github.event.number }} - # - name: Save AVD Cache - # uses: actions/cache/save@v3 - # if: always() && !steps.avd-cache.outputs.cache-hit - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} - Test_APK_Win: - runs-on: windows-latest - steps: - - name: Test HyperV - shell: powershell - run: | - Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V - get-service | findstr vmcompute + # # - name: Save AVD Cache + # # uses: actions/cache/save@v3 + # # if: always() && !steps.avd-cache.outputs.cache-hit + # # with: + # # path: | + # # ~/.android/avd/* + # # ~/.android/adb* + # # key: avd-${{ matrix.api-level }} + # Test_APK_Win: + # runs-on: windows-latest + # steps: + # - name: Test HyperV + # shell: powershell + # run: | + # Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V + # get-service | findstr vmcompute - - name: Test emu - shell: bash - run: | - $ANDROID_HOME\\emulator\\emulator -accel-check + # - name: Test emu + # shell: bash + # run: | + # $ANDROID_HOME\\emulator\\emulator -accel-check # Test_APK_Win: # name: Test APK Win From f4184d7667738e989d6e8a962968df77c87562a2 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 10:39:14 +0530 Subject: [PATCH 102/107] Update .cirrus.yml --- .cirrus.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f8157b15..9d6444ad 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,20 +1,20 @@ # windows_container: # image: cirrusci/windowsservercore:2019 -assemble_task: - env: - API_LEVEL: 30 - TARGET: google_apis - ARCH: x86 - container: - image: reactivecircus/android-emulator-30:latest - kvm: true - cpu: 8 - memory: 24G - create_device_script: - echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" - # start_emulator_background_script: - # $ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none - # wait_for_emulator_script: - assemble_script: - emulator -accel-check \ No newline at end of file +# assemble_task: +# env: +# API_LEVEL: 30 +# TARGET: google_apis +# ARCH: x86 +# container: +# image: reactivecircus/android-emulator-30:latest +# kvm: true +# cpu: 8 +# memory: 24G +# create_device_script: +# echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" +# # start_emulator_background_script: +# # $ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none +# # wait_for_emulator_script: +# assemble_script: +# emulator -accel-check \ No newline at end of file From d7b663c070cf2be7b900f1d9fed8826e7522b6d7 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 10:42:05 +0530 Subject: [PATCH 103/107] Update build.yml --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c251d9e..3cf2fa4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,6 +168,7 @@ jobs: EMU_PROFILE: pixel_2 EMU_AVD_NAME: Pixel_2 EMU_TARGET: playstore # google_apis + EMU_TIMEOUT: 1200 strategy: matrix: @@ -224,6 +225,7 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 id: avd_create_1 continue-on-error: true + emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} @@ -240,6 +242,7 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 id: avd_create_2 continue-on-error: true + emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} @@ -255,7 +258,8 @@ jobs: if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' uses: reactivecircus/android-emulator-runner@v2 id: avd_create_3 - # continue-on-error: true # Fail if even fail the 3rd try + emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} + # continue-on-error: true # Fail, if failed in the 3rd try with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} From 24a083af2c605288f90b712e2ad6ca479d80029e Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 10:53:04 +0530 Subject: [PATCH 104/107] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cf2fa4b..8708e5cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -225,7 +225,6 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 id: avd_create_1 continue-on-error: true - emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} @@ -235,6 +234,7 @@ jobs: disable-animations: false profile: ${{ env.EMU_PROFILE }} avd-name: ${{ env.EMU_AVD_NAME }} + emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} script: echo "Generated AVD snapshot for caching." - name: create AVD and generate snapshot for caching try#2 @@ -242,7 +242,6 @@ jobs: uses: reactivecircus/android-emulator-runner@v2 id: avd_create_2 continue-on-error: true - emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} with: working-directory: ${{env.GRADLE_DIR}} api-level: ${{ matrix.api-level }} @@ -252,13 +251,13 @@ jobs: disable-animations: false profile: ${{ env.EMU_PROFILE }} avd-name: ${{ env.EMU_AVD_NAME }} + emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} script: echo "Generated AVD snapshot for caching." - name: create AVD and generate snapshot for caching try#3 if: steps.avd-cache.outputs.cache-hit != 'true' && steps.avd_create_2.outcome == 'failure' uses: reactivecircus/android-emulator-runner@v2 id: avd_create_3 - emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} # continue-on-error: true # Fail, if failed in the 3rd try with: working-directory: ${{env.GRADLE_DIR}} @@ -269,6 +268,7 @@ jobs: disable-animations: false profile: ${{ env.EMU_PROFILE }} avd-name: ${{ env.EMU_AVD_NAME }} + emulator-boot-timeout: ${{ env.EMU_TIMEOUT }} script: echo "Generated AVD snapshot for caching." ## Redundancy End From 8742940a5de696aa7f912ef59cb8f09eccb27cd3 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 11:03:28 +0530 Subject: [PATCH 105/107] Update build.yml --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8708e5cd..2fad2b73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -443,9 +443,9 @@ jobs: echo "# 📷 Screenshots of tests:" >> comment.md echo "" >> comment.md - ls -alh - ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ - stat 'app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' + # ls -alh + # ls -alh app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/ + # stat 'app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/Pixel_2(AVD) - 11/InitActivityTest_saveDeviceScreenBitmap.png' # for each AVD Image for ss_test_avd in app/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/*; do @@ -463,11 +463,13 @@ jobs: ss_test_desc=$(basename "$ss_test" .png) + echo "" >> comment.md echo "#### 🔧 $ss_test_desc" >> comment.md + echo "" >> comment.md echo "$WK_DIR + / + $ss_test" echo '

' >> comment.md - cml-publish "$ss_test" | gsed -E 's/.+//' >> comment.md + cml-publish "$ss_test" | gsed -E 's/.+//' >> comment.md echo '

' >> comment.md done From 231f38f67f1089c1e463cdbb9fe312585b9eecfa Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 11:46:42 +0530 Subject: [PATCH 106/107] Update build.yml --- .github/workflows/build.yml | 246 ++++++++++++++++++------------------ 1 file changed, 123 insertions(+), 123 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fad2b73..17af0eb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,143 +22,143 @@ on: # working-directory: code/mobile/android/PhoneVR jobs: - # Build_PVR_Server: - # name: Build PhoneVR Server - # strategy: - # fail-fast: false - # matrix: - # config: [Release, Debug] - # platform: [x64, x86] - # runs-on: windows-latest + Build_PVR_Server: + name: Build PhoneVR Server + strategy: + fail-fast: false + matrix: + config: [Release, Debug] + platform: [x64, x86] + runs-on: windows-latest - # steps: - # - uses: actions/checkout@v3 - - # # https://github.com/actions/runner-images/issues/842#issuecomment-1495115166 - # - name: Install MSVC 2015 (v140) and Windows 8.1 SDK - # shell: powershell - # run: | - # $VS_BTOOLS_EXE="vs_buildtools.exe" - # $VS_BTOOLS_URI="https://aka.ms/vs/15/release/vs_buildtools.exe" - # Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE - # Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList ` - # "--add", "Microsoft.VisualStudio.Component.VC.140", ` - # "--add", "Microsoft.VisualStudio.Component.Windows81SDK", ` - # "--quiet", "--norestart", "--force", "--wait" -Wait -PassThru - - # - name: Add MSBuild to PATH - # uses: microsoft/setup-msbuild@v1.0.2 - - # - name: Restore NuGet packages - # working-directory: ${{env.GITHUB_WORKSPACE}} - # run: nuget restore ${{env.SOLUTION_FILE_PATH}} - - # - name: Building ${{matrix.platform}}-${{matrix.config}} - # working-directory: ${{env.GITHUB_WORKSPACE}} - # # Add additional options to the MSBuild command line here (like platform or verbosity level). - # # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - # run: msbuild /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} ${{env.SOLUTION_FILE_PATH}} - - # - name: Upload Build outputs - # uses: actions/upload-artifact@v2 - # with: - # name: ${{ env.PROJECT_NAME }}-Server-${{ matrix.config }} - # path: ${{ env.SOLUTION_DIR }}\${{ matrix.config }} + steps: + - uses: actions/checkout@v3 + + # https://github.com/actions/runner-images/issues/842#issuecomment-1495115166 + - name: Install MSVC 2015 (v140) and Windows 8.1 SDK + shell: powershell + run: | + $VS_BTOOLS_EXE="vs_buildtools.exe" + $VS_BTOOLS_URI="https://aka.ms/vs/15/release/vs_buildtools.exe" + Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE + Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList ` + "--add", "Microsoft.VisualStudio.Component.VC.140", ` + "--add", "Microsoft.VisualStudio.Component.Windows81SDK", ` + "--quiet", "--norestart", "--force", "--wait" -Wait -PassThru + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Restore NuGet packages + working-directory: ${{env.GITHUB_WORKSPACE}} + run: nuget restore ${{env.SOLUTION_FILE_PATH}} + + - name: Building ${{matrix.platform}}-${{matrix.config}} + working-directory: ${{env.GITHUB_WORKSPACE}} + # Add additional options to the MSBuild command line here (like platform or verbosity level). + # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference + run: msbuild /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} ${{env.SOLUTION_FILE_PATH}} + + - name: Upload Build outputs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROJECT_NAME }}-Server-${{ matrix.config }} + path: ${{ env.SOLUTION_DIR }}\${{ matrix.config }} - # Build_APK: - # name: Build Android APK - # runs-on: ubuntu-latest + Build_APK: + name: Build Android APK + runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: 'true' + steps: + - uses: actions/checkout@v3 + with: + submodules: 'true' - # # Set Current Date As Env Variable - # - name: Set current date as env variable - # id: vars - # shell: bash - # run: | - # echo "date_today=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" - # echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - # echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + # Set Current Date As Env Variable + - name: Set current date as env variable + id: vars + shell: bash + run: | + echo "date_today=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" + echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - # - name: Set Up JDK - # uses: actions/setup-java@v3 - # with: - # distribution: 'oracle' - # java-version: '17' + - name: Set Up JDK + uses: actions/setup-java@v3 + with: + distribution: 'oracle' + java-version: '17' - # # Only for Testing github-actions - # - uses: actions-rs/toolchain@v1 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # profile: minimal - # toolchain: stable - # override: true - # components: clippy - # - uses: Swatinem/rust-cache@v2 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # cache-on-failure: true - # workspaces: ${{env.GRADLE_DIR}}/ALVR/ + # Only for Testing github-actions + - uses: actions-rs/toolchain@v1 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: Swatinem/rust-cache@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + cache-on-failure: true + workspaces: ${{env.GRADLE_DIR}}/ALVR/ - # - uses: gradle/gradle-build-action@v2 - # if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo - # with: - # build-root-directory: ${{env.GRADLE_DIR}} - # cache-read-only: ${{ false }} + - uses: gradle/gradle-build-action@v2 + if: ${{ github.event.pull_request.head.repo.full_name != '${{ env.ORG_FULL }}' }} # Only run if not on master repo + with: + build-root-directory: ${{env.GRADLE_DIR}} + cache-read-only: ${{ false }} - # - name: Prepare deps - # run: | - # ls -alh - # cd code/mobile/android/PhoneVR - # chmod +x prepare-alvr-deps.sh - # bash prepare-alvr-deps.sh + - name: Prepare deps + run: | + ls -alh + cd code/mobile/android/PhoneVR + chmod +x prepare-alvr-deps.sh + bash prepare-alvr-deps.sh - # - name: Change gradle wrapper permissions - # run: | - # cd code/mobile/android/PhoneVR - # chmod +x ./gradlew - # ls -alh - # ls -alh app + - name: Change gradle wrapper permissions + run: | + cd code/mobile/android/PhoneVR + chmod +x ./gradlew + ls -alh + ls -alh app - # # Create APK Debug - # - name: Build apk debug project (APK) - # run: | - # cd code/mobile/android/PhoneVR - # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # Create APK Debug + - name: Build apk debug project (APK) + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # # Create APK Release - # - name: Build apk release project (APK) - # env: - # Key: ${{ secrets.KEY }} - # Store: ${{ secrets.STORE }} - # run: | - # cd code/mobile/android/PhoneVR - # ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assemble --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} + # Create APK Release + - name: Build apk release project (APK) + env: + Key: ${{ secrets.KEY }} + Store: ${{ secrets.STORE }} + run: | + cd code/mobile/android/PhoneVR + ./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assemble --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}} - # # Upload Artifact Build - # # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/debug/ - # - name: Upload APK Debug - # uses: actions/upload-artifact@v2 - # with: - # name: ${{ env.PROJECT_NAME }}-debug-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK - # path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/debug/ + # Upload Artifact Build + # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/debug/ + - name: Upload APK Debug + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROJECT_NAME }}-debug-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK + path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/debug/ - # # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/release/ - # - name: Upload APK Release - # uses: actions/upload-artifact@v2 - # with: - # name: ${{ env.PROJECT_NAME }}-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK - # path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/release/ + # Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/release/ + - name: Upload APK Release + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROJECT_NAME }}-${{ steps.vars.outputs.sha_short }}-${{ env.date_today }} APK + path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/release/ - # - name: Upload Build outputs on failure - # if: failure() - # uses: actions/upload-artifact@v2 - # with: - # name: build-files - # path: ${{ env.GRADLE_DIR }}/app/.cxx/ + - name: Upload Build outputs on failure + if: failure() + uses: actions/upload-artifact@v2 + with: + name: build-files + path: ${{ env.GRADLE_DIR }}/app/.cxx/ Test_APK: name: Test APK From 85fe06911714ca8a911fc0891148de8923fc3fb0 Mon Sep 17 00:00:00 2001 From: Harsha Raghu Date: Tue, 9 May 2023 11:48:05 +0530 Subject: [PATCH 107/107] Delete .cirrus.yml --- .cirrus.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 9d6444ad..00000000 --- a/.cirrus.yml +++ /dev/null @@ -1,20 +0,0 @@ -# windows_container: -# image: cirrusci/windowsservercore:2019 - -# assemble_task: -# env: -# API_LEVEL: 30 -# TARGET: google_apis -# ARCH: x86 -# container: -# image: reactivecircus/android-emulator-30:latest -# kvm: true -# cpu: 8 -# memory: 24G -# create_device_script: -# echo no | avdmanager create avd --force --name "api-${API_LEVEL}" --abi "${TARGET}/${ARCH}" --package "system-images;android-${API_LEVEL};${TARGET};${ARCH}" -# # start_emulator_background_script: -# # $ANDROID_HOME/emulator/emulator -avd "api-${API_LEVEL}" -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -# # wait_for_emulator_script: -# assemble_script: -# emulator -accel-check \ No newline at end of file