diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 774a64c23e..727a41040f 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -64,6 +64,8 @@ jobs: run: | nix develop -c sh -c 'emulator -avd Pixel_API_34 -gpu swiftshader -wipe-data -no-boot-anim' & nix develop -c adb wait-for-device + nix develop -c sh -c 'adb shell screenrecord --bit-rate 4000000 --time-limit 99999999 /sdcard/screenRecord.mp4' & + echo "EMU_RECORD=$!" >> $GITHUB_ENV - name: Run Detox Tests on Android Emulator uses: nick-fields/retry@v3 @@ -80,7 +82,11 @@ jobs: - name: Kill Android Emulator if: always() continue-on-error: true - run: nix develop -c adb emu kill + run: | + kill -SIGINT $EMU_RECORD + nix develop -c adb pull /sdcard/screenRecord.mp4 ./screenRecordUnopt.mp4 + ffmpeg -i screenRecordUnopt.mp4 screenRecord.mp4 + nix develop -c adb emu kill - uses: actions/upload-artifact@v4 if: always() @@ -96,30 +102,29 @@ jobs: - uses: "google-github-actions/upload-cloud-storage@v2" if: always() with: - path: android-recordings + path: screenRecord.mp4 + gzip: false predefinedAcl: publicRead - glob: "**/*.mp4" headers: |- content-type: video/mp4 destination: galoy-mobile-recordings/android-recordings/${{ github.run_id }} - name: Append Direct Links to GitHub Actions Summary if: always() run: | - # Define the base URL for the uploaded files in the GCS bucket - BASE_URL="https://storage.googleapis.com/galoy-mobile-recordings/android-recordings/${{ github.run_id }}/android-recordings" - echo "## Android Recordings" >> $GITHUB_STEP_SUMMARY + echo "## Android Recording" > $GITHUB_STEP_SUMMARY + + COMPLETE_RECORDING_URL="https://storage.googleapis.com/galoy-mobile-recordings/android-recordings/${{ github.run_id }}/screenRecord.mp4" + echo "Full Recording: [Click here](<$COMPLETE_RECORDING_URL>)" >> $GITHUB_STEP_SUMMARY + + echo "" >> $GITHUB_STEP_SUMMARY + echo "Test Suite:" >> $GITHUB_STEP_SUMMARY find android-recordings -type f -name "*.mp4" | while read file; do - # Extract the relative path of the file within the android-recordings folder RELATIVE_PATH="${file#android-recordings/}" - - # Construct the direct URL for the file FILE_URL="${BASE_URL}/${RELATIVE_PATH}" - TEST_NAME=$(echo "$RELATIVE_PATH" | sed -E 's|.*/(.*)/test\.mp4|\1|') - # Append the URL to the GitHub Actions summary - echo "- $TEST_NAME [Recording](<$FILE_URL>)" >> $GITHUB_STEP_SUMMARY + echo "- $TEST_NAME" >> $GITHUB_STEP_SUMMARY done # Cleanup @@ -188,6 +193,17 @@ jobs: nix develop -c sh -c 'cd dev && tilt up' & echo "TILT_SERVER_PID=$!" >> $GITHUB_ENV + - name: Record Simulator in Background + run: | + DEVICE_ID=$(xcrun simctl list devices | grep "iPhone SE (3rd generation)" | cut -d' ' -f9 | tr -d '()') + open -a Simulator --args -CurrentDeviceUDID $DEVICE_ID + while ! xcrun simctl list devices | grep "(Booted)"; do + sleep 1 + echo "Waiting for Simulator device to come online..." + done + xcrun simctl io booted recordVideo screenRecord.mov & + echo "SIM_RECORD=$!" >> $GITHUB_ENV + # Tests on iOS Simulator - name: Run Detox Tests on iOS Simulator uses: nick-fields/retry@v3 @@ -201,6 +217,13 @@ jobs: nix develop -c tilt wait --timeout 5m --for=condition=Ready uiresources dev-setup nix develop -c yarn e2e:test ios.sim.debug -d -R 5 --take-screenshots all --record-videos all --record-logs all --artifacts-location ios-recordings + - name: Stop Recording + if: always() + continue-on-error: true + run: | + kill -SIGINT $SIM_RECORD + ffmpeg -i screenRecord.mov screenRecord.mp4 + - run: killall Simulator if: always() continue-on-error: true @@ -211,7 +234,7 @@ jobs: name: ios-recordings path: ios-recordings - # Upload recordings to GCS bucket + # Upload recording to GCS bucket - uses: "google-github-actions/auth@v2" if: always() with: @@ -219,30 +242,29 @@ jobs: - uses: "google-github-actions/upload-cloud-storage@v2" if: always() with: - path: ios-recordings + path: screenRecord.mp4 + gzip: false predefinedAcl: publicRead - glob: "**/*.mp4" headers: |- content-type: video/mp4 destination: galoy-mobile-recordings/ios-recordings/${{ github.run_id }} - name: Append Direct Links to GitHub Actions Summary if: always() run: | - # Define the base URL for the uploaded files in the GCS bucket - BASE_URL="https://storage.googleapis.com/galoy-mobile-recordings/ios-recordings/${{ github.run_id }}/ios-recordings" - echo "## iOS Recordings" >> $GITHUB_STEP_SUMMARY + echo "## iOS Recording" > $GITHUB_STEP_SUMMARY + + COMPLETE_RECORDING_URL="https://storage.googleapis.com/galoy-mobile-recordings/ios-recordings/${{ github.run_id }}/screenRecord.mp4" + echo "Full Recording: [Click here](<$COMPLETE_RECORDING_URL>)" >> $GITHUB_STEP_SUMMARY + + echo "" >> $GITHUB_STEP_SUMMARY + echo "Test Suite:" >> $GITHUB_STEP_SUMMARY find ios-recordings -type f -name "*.mp4" | while read file; do - # Extract the relative path of the file within the ios-recordings folder RELATIVE_PATH="${file#ios-recordings/}" - - # Construct the direct URL for the file FILE_URL="${BASE_URL}/${RELATIVE_PATH}" - TEST_NAME=$(echo "$RELATIVE_PATH" | sed -E 's|.*/(.*)/test\.mp4|\1|') - # Append the URL to the GitHub Actions summary - echo "- $TEST_NAME [Recording](<$FILE_URL>)" >> $GITHUB_STEP_SUMMARY + echo "- $TEST_NAME" >> $GITHUB_STEP_SUMMARY done # Cleanup diff --git a/filename.mp4 b/filename.mp4 new file mode 100644 index 0000000000..94a4fb55da Binary files /dev/null and b/filename.mp4 differ