Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ci: CI changes to pre-test PR #372 #379

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 79 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,45 +152,81 @@ jobs:
ls -alh
cd code/mobile/android/PhoneVR
chmod +x prepare-alvr-deps.sh
bash prepare-alvr-deps.sh
bash prepare-alvr-deps.sh nogvr

- 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 noGvr debug project (APK)
run: |
cd code/mobile/android/PhoneVR
./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleNoGvrDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}}

# Create APK Release
- name: Build apk noGvr release project (APK)
env:
Key: ${{ secrets.KEY }}
Store: ${{ secrets.STORE }}
run: |
cd code/mobile/android/PhoneVR
./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleNoGvrRelease --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}}

- name: Prepare deps
run: |
ls -alh
cd code/mobile/android/PhoneVR
chmod +x prepare-alvr-deps.sh
bash prepare-alvr-deps.sh

# Create APK Debug
- name: Build apk debug project (APK)
- name: Build apk gvr 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}}
./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleGvrDebug --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}}

# Create APK Release
- name: Build apk release project (APK)
- name: Build apk gvr 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}}
./gradlew :${{ env.MAIN_PROJECT_MODULE }}:assembleGvrRelease --warning-mode=all --stacktrace -Dorg.gradle.java.home=${{env.JAVA_HOME}}

# Upload Artifact Build
# Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/debug/
# Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/gvr/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/
path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/gvr/debug/

# Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/release/
# Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/gvr/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/
path: ${{env.GRADLE_DIR}}/${{ env.MAIN_PROJECT_MODULE }}/build/outputs/apk/gvr/release/

# Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/noGvr/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/noGvr/debug/

# Noted For Output [MAIN_PROJECT_MODULE]/build/outputs/apk/noGvr/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/noGvr/release/

- name: Upload Build outputs on failure
if: failure()
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -384,13 +420,14 @@ 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
# build/outputs/connected_android_test_additional_output/gvrDebugAndroidTest/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/outputs/connected_android_test_additional_output/gvrDebugAndroidTest/connected/*
**/app/build/outputs/connected_android_test_additional_output/noGvrDebugAndroidTest/connected/*
**/app/build/reports
**/app/build/test-results
**/app/build/outputs/androidTest-results
Expand Down Expand Up @@ -474,22 +511,48 @@ jobs:
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 app/build/outputs/connected_android_test_additional_output/gvrDebugAndroidTest/connected/
# stat 'app/build/outputs/connected_android_test_additional_output/gvrDebugAndroidTest/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 ss_test_avd in app/build/outputs/connected_android_test_additional_output/gvrDebugAndroidTest/connected/*; do

ls -alh "$ss_test_avd"
echo "$ss_test_avd"
ss_test_avd_desc=$(basename "$ss_test_avd")

echo "" >> comment.md
echo "### 📱gvr: $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/gvrDebugAndroidTest/connected/$ss_test_avd_desc/"*.png; do

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 '<p float="left">' >> comment.md
cml-publish "$ss_test" | gsed -E 's/.+/<img width="70%" src="\0"\/>/' >> comment.md
echo '</p>' >> comment.md

done
done
for ss_test_avd in app/build/outputs/connected_android_test_additional_output/noGvrDebugAndroidTest/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 "### 📱noGvr: $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 ss_test in "app/build/outputs/connected_android_test_additional_output/noGvrDebugAndroidTest/connected/$ss_test_avd_desc/"*.png; do

ss_test_desc=$(basename "$ss_test" .png)

Expand Down
Loading