From 23a4889565db83429553f13496d9f59e823c42d9 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 15:18:31 +0500 Subject: [PATCH 1/2] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 60 +++++++++++++------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index aeef02be..4507da24 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -67,7 +67,7 @@ jobs: docker-manual-android-run: if: github.event_name != 'schedule' name: Manual - ${{ inputs.tags }} - runs-on: macos-latest + runs-on: ubuntu-latest steps: - name: Validate Input Parameter id: validate_input @@ -89,6 +89,48 @@ jobs: if: steps.setup_python.outcome == 'success' uses: actions/checkout@v4 + - name: Install and Run Appium Server + id: setup_appium + if: steps.setup_java.outcome == 'success' + run: | + npm install -g appium + appium --log-level info & + sleep 5 + appium -v + + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-29 + + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 29 + 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: start emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 29 + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + - name: Setup dependencies id: setup_dependencies if: steps.co_code.outcome == 'success' @@ -103,22 +145,6 @@ jobs: distribution: 'temurin' java-version: '21' - - name: Install and Run Appium Server - id: setup_appium - if: steps.setup_java.outcome == 'success' - run: | - npm install -g appium - appium --log-level info & - sleep 5 - appium -v - - - name: Run emulator - id: run_emulator - if: steps.setup_appium.outcome == 'success' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 29 - - name: Run Env Job Tests id: run_manual_job if: steps.run_emulator.outcome == 'success' From d5c71176e08fa53a65c01668cabf25314c295966 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 15:21:03 +0500 Subject: [PATCH 2/2] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 4507da24..158be6a6 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -91,7 +91,7 @@ jobs: - name: Install and Run Appium Server id: setup_appium - if: steps.setup_java.outcome == 'success' + if: steps.co_code.outcome == 'success' run: | npm install -g appium appium --log-level info & @@ -124,6 +124,7 @@ jobs: script: echo "Generated AVD snapshot for caching." - name: start emulator + id: start_emulator uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 @@ -147,7 +148,7 @@ jobs: - name: Run Env Job Tests id: run_manual_job - if: steps.run_emulator.outcome == 'success' + if: steps.start_emulator.outcome == 'success' run: | TAGS="${{ github.event.inputs.tags }}" env