From ec0ef81e340d331fd7594c991d3c035556716ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Wed, 16 Jul 2025 13:23:40 +0100 Subject: [PATCH 1/3] feat(INFRA-2766): update for ubuntu runners --- .github/actions/setup-e2e-env/action.yml | 95 +++++++++++++++--------- 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 2be4eef4..3be0311e 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -230,7 +230,13 @@ runs: if: ${{ inputs.platform == 'android' && runner.os == 'Linux' }} run: | sudo apt-get update - sudo apt-get install -y libpulse0 libglu1-mesa + sudo apt-get install -y \ + libpulse0 \ + libglu1-mesa \ + libnss3 \ + libxss1 + + echo "✅ Linux dependencies installed successfully" shell: bash - name: Install Android SDK packages @@ -245,10 +251,12 @@ runs: "platforms;android-${{ inputs.android-api-level }}" \ "build-tools;34.0.0" \ "emulator" \ - "system-images;android-34;google_apis;${{ inputs.android-abi }}" \ + "system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" \ echo "Updating SDK packages..." "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update + + echo "✅ Android SDK packages installed successfully" shell: bash ## NDK Setup @@ -260,24 +268,6 @@ runs: echo "ANDROID_SDK_ROOT: $ANDROID_SDK_ROOT" shell: bash - - name: Accept Android SDK licenses - if: ${{ inputs.platform == 'android' }} - run: | - echo "Accepting Android SDK licenses..." - bash -c 'yes | "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --licenses' || true - shell: bash - - - name: Install Android SDK Packages - if: ${{ inputs.platform == 'android' }} - run: | - "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --install \ - "platform-tools" \ - "platforms;android-${{ inputs.android-api-level }}" \ - "build-tools;34.0.0" \ - "emulator" \ - "system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" - shell: bash - - name: Install Android NDK if: ${{ inputs.platform == 'android' }} run: | @@ -295,21 +285,17 @@ runs: - name: Add NDK related toolchains to PATH if: ${{ inputs.platform == 'android' }} run: | - NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin" + if [ "$RUNNER_OS" = "Linux" ]; then + NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin" + else + NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/darwin-x86_64/bin" + fi echo "$NDK_TOOLCHAIN" >> "$GITHUB_PATH" echo "$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> "$GITHUB_PATH" shell: bash ## Launch AVD - - name: Install Android system image - if: ${{ inputs.platform == 'android' }} - run: | - IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;${{ inputs.android-abi }}" - echo "Installing system image: $IMAGE" - "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install "$IMAGE" - shell: bash - - name: Set ANDROID_AVD_HOME for downstream steps if: ${{ inputs.platform == 'android'}} shell: bash @@ -332,11 +318,16 @@ runs: - name: Launch Android Emulator if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | + # Linux with KVM hardware acceleration nohup "$ANDROID_HOME/emulator/emulator" \ -avd "${{ inputs.android-avd-name }}" \ -no-audio \ -no-boot-anim \ -no-window \ + -gpu swiftshader_indirect \ + -no-snapshot \ + -wipe-data \ + -accel on \ -verbose > /dev/null 2>&1 & shell: bash @@ -344,26 +335,56 @@ runs: - name: Wait for Android Emulator to Boot if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | - echo "Waiting for emulator to be ready..." + echo "Waiting for emulator to be ready on $RUNNER_OS..." + + # Wait for device to be detected by ADB + echo "Waiting for ADB to detect device..." adb wait-for-device - + + # Additional wait for emulator to stabilize + sleep 10 + + # Check emulator status + echo "Checking emulator processes..." + if [ "$RUNNER_OS" = "Linux" ]; then + ps aux | grep emulator || echo "No emulator processes found" + fi + + # Wait for boot to complete bootanim="" - timeout=300 # 5 minutes in seconds + timeout=600 # 10 minutes for initial boot (Linux might be slower) elapsed=0 while [[ "$elapsed" -lt "$timeout" ]]; do bootanim=$(adb shell getprop init.svc.bootanim 2>/dev/null || echo "unknown") - echo "Waiting for emulator... ($bootanim) (${elapsed}s elapsed)" + sys_boot_completed=$(adb shell getprop sys.boot_completed 2>/dev/null || echo "0") + + echo "Waiting for emulator... bootanim: $bootanim, boot_completed: $sys_boot_completed (${elapsed}s elapsed)" - if [[ "$bootanim" == *"stopped"* ]]; then + if [[ "$bootanim" == *"stopped"* ]] && [[ "$sys_boot_completed" == "1" ]]; then echo "✅ Emulator booted successfully" + + # Unlock screen and disable animations for testing + adb shell input keyevent 82 # Unlock + adb shell settings put global window_animation_scale 0 + adb shell settings put global transition_animation_scale 0 + adb shell settings put global animator_duration_scale 0 + + echo "✅ Emulator is ready for testing" exit 0 fi - sleep 5 - elapsed=$((elapsed + 5)) + sleep 10 + elapsed=$((elapsed + 10)) done echo "❌ Timeout waiting for emulator to boot" + + # Debug information on failure + echo "Debug: ADB devices:" + adb devices + echo "Debug: Emulator processes:" + ps aux | grep emulator || echo "No emulator processes found" + exit 1 - shell: bash + shell: bash From d2a46765743a748613d054f4bef57704a15d85e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Wed, 16 Jul 2025 13:36:37 +0100 Subject: [PATCH 2/3] feat(INFRA-2766): remove ios references not used --- .github/actions/setup-e2e-env/action.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index 3be0311e..c44681ac 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -285,11 +285,7 @@ runs: - name: Add NDK related toolchains to PATH if: ${{ inputs.platform == 'android' }} run: | - if [ "$RUNNER_OS" = "Linux" ]; then - NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin" - else - NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/darwin-x86_64/bin" - fi + NDK_TOOLCHAIN="$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}/toolchains/llvm/prebuilt/linux-x86_64/bin" echo "$NDK_TOOLCHAIN" >> "$GITHUB_PATH" echo "$ANDROID_SDK_ROOT/ndk/${{ inputs.ndk-version }}" >> "$GITHUB_PATH" shell: bash From 3ef4134e4a1ca8d74e290a4e9a875477c72feadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o?= Date: Wed, 16 Jul 2025 14:00:38 +0100 Subject: [PATCH 3/3] feat(INFRA-2766): pwetty --- .github/actions/setup-e2e-env/action.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup-e2e-env/action.yml b/.github/actions/setup-e2e-env/action.yml index c44681ac..2a29f58f 100644 --- a/.github/actions/setup-e2e-env/action.yml +++ b/.github/actions/setup-e2e-env/action.yml @@ -235,7 +235,7 @@ runs: libglu1-mesa \ libnss3 \ libxss1 - + echo "✅ Linux dependencies installed successfully" shell: bash @@ -255,7 +255,7 @@ runs: echo "Updating SDK packages..." "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --update - + echo "✅ Android SDK packages installed successfully" shell: bash @@ -332,20 +332,20 @@ runs: if: ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }} run: | echo "Waiting for emulator to be ready on $RUNNER_OS..." - + # Wait for device to be detected by ADB echo "Waiting for ADB to detect device..." adb wait-for-device - + # Additional wait for emulator to stabilize sleep 10 - + # Check emulator status echo "Checking emulator processes..." if [ "$RUNNER_OS" = "Linux" ]; then ps aux | grep emulator || echo "No emulator processes found" fi - + # Wait for boot to complete bootanim="" timeout=600 # 10 minutes for initial boot (Linux might be slower) @@ -375,12 +375,12 @@ runs: done echo "❌ Timeout waiting for emulator to boot" - + # Debug information on failure echo "Debug: ADB devices:" adb devices echo "Debug: Emulator processes:" ps aux | grep emulator || echo "No emulator processes found" - + exit 1 - shell: bash + shell: bash