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 #80

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
33 changes: 16 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ jobs:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
include:
- runs-on: ubuntu-latest
- pre-command:
- briefcase-target:
- briefcase-run-args:
- pre-command: ""
- briefcase-target: ""
- briefcase-run-args: ""

- backend: macOS-Xcode
runs-on: macos-latest
Expand Down Expand Up @@ -92,19 +92,7 @@ jobs:
- backend: android
runs-on: "ubuntu-latest"
briefcase-target: "android"
briefcase-run-args: >
--device '{"avd":"beePhone"}'
--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

exclude:
# Binary packages aren't available for 3.11+ on Android yet
- backend: "android"
Expand All @@ -128,11 +116,22 @@ jobs:
- name: Install Dependencies
run: ${{ matrix.pre-command }}

- 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"}'

- name: Install Briefcase
uses: beeware/.github/.github/actions/install-briefcase@main

- name: Test App
run: briefcase run ${{ matrix.briefcase-target }} --test ${{ matrix.briefcase-run-args }}
run: >
briefcase run ${{ matrix.briefcase-target }}
--test
${{ matrix.briefcase-run-args }}
${{ steps.emulator.outputs.briefcase-run-args }}

- name: Package
run: briefcase package ${{ matrix.briefcase-target }} --update --adhoc-sign
Expand Down
Loading