Skip to content

Commit

Permalink
Docker Mobile Android (#40)
Browse files Browse the repository at this point in the history
### To be filled by the PR creator:

* A brief description of the changes made - 

* Do we have clean latest run report attached with this PR?
  * [ ] Yes
  * [ ] No (Please explain why)

* Does the PR contain changes to any BP core file?
  * [ ] Yes (Needs approval from at least 2 people)
  * [ ] No

* Does the PR contain changes to modules shared with other teams?
* [ ] Yes (Needs approval from at least one of the other teams that use
the module)
  * [ ] No

* Is it
  * [ ] New Testcase
  * [ ] Fix


### To be filled by the PR reviewer:

* [ ] Verify the attached run report passed in GitHub Actions (Justify
if local run)

* General
    * [ ] Use the best strategy to locate the elements
    * [ ] Comments wherever the code is not readable by itself
    * [ ] Use of the right data structure for the use case
    * [ ] Reuse logic/functionality as much as possible
    * [ ] Cleanup of any test data that is generated by the tests
    * [ ] No static waits
  • Loading branch information
Tauqir Sarwar authored Mar 19, 2024
2 parents d98b061 + d5c7117 commit 0d4a07e
Showing 1 changed file with 45 additions and 18 deletions.
63 changes: 45 additions & 18 deletions .github/workflows/docker_android_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -89,6 +89,49 @@ jobs:
if: steps.setup_python.outcome == 'success'
uses: actions/checkout@v4

- name: Install and Run Appium Server
id: setup_appium
if: steps.co_code.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
id: 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'
Expand All @@ -103,25 +146,9 @@ 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'
if: steps.start_emulator.outcome == 'success'
run: |
TAGS="${{ github.event.inputs.tags }}"
env
Expand Down

0 comments on commit 0d4a07e

Please sign in to comment.