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

Implement action to setup Android emulator in CI #2597

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
30 changes: 14 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,7 @@ jobs:
platform: "android"
runs-on: "ubuntu-latest"
briefcase-run-prefix: JAVA_HOME=${JAVA_HOME_17_X64}
briefcase-run-args: >
--device '{"avd":"beePhone","skin":"pixel_3a"}'
--Xemulator=-no-window
--Xemulator=-no-snapshot
--Xemulator=-no-audio
--Xemulator=-no-boot-anim
--shutdown-on-exit
pre-command: |
# allow access to KVM to run the emulator
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

steps:
- name: Checkout
uses: actions/checkout@v4.1.6
Expand All @@ -281,12 +269,22 @@ jobs:
python -m pip install -U pip
python -m pip install git+https://github.com/beeware/briefcase.git

- name: Setup Android Emulator
id: emulator
if: matrix.backend == 'android'
uses: rmartin16/.github-beeware/.github/actions/setup-android@setup-android
with:
emulator-config: '{"avd":"beePhone","skin":"pixel_3a"}'

- name: Test App
working-directory: testbed
timeout-minutes: 15
run: |
${{ matrix.briefcase-run-prefix }} \
briefcase run ${{ matrix.platform }} --test ${{ matrix.briefcase-run-args }}
run: >
${{ matrix.briefcase-run-prefix }}
briefcase run ${{ matrix.platform }}
--test
${{ matrix.briefcase-run-args }}
${{ steps.emulator.outputs.briefcase-run-args }}

- name: Upload Logs
uses: actions/upload-artifact@v4.3.3
Expand Down
1 change: 1 addition & 0 deletions changes/2597.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI now uses a centralized action to configure the environment for using the Android emulator.
Loading