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

ci: re-enable android emulator tests #54

Merged
merged 24 commits into from
Oct 1, 2024
Merged
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
32 changes: 15 additions & 17 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
path: ./bazel-bin/examples/android/android_app.apk
gradle_tests:
# Requires a "larger runner", for nested virtualization support
runs-on: ubuntu-latest
runs-on: ubuntu-latest-8-cores
env:
SKIP_PROTO_GEN: 1
if: needs.pre_check.outputs.should_run == 'true'
Expand All @@ -97,16 +97,16 @@ jobs:
# See https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
- name: Enable KVM group perms
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really required to be a part of this PR but since it effectively doesn't work as we moved to ubuntu-latest recently I decided to clean it up (remove)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i forgot why we removed using virtualization?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to ubuntu-latest was fixing another issues that we had while trying to update to the latest version of the NDK https://github.com/bitdriftlabs/capture-sdk/pull/40/files#diff-fc26471d058677138d1caf923b0188a49eaf3437ba2f1cec8a6927ee0a1f0402R88. ubuntu-latest-8-cores didn't have the latest version of NDK available while ubuntu-latest had it.

Now that I am playing with it I cannot even make the gradle_tests CI job work with ubuntu-latest anymore so moving back to -8-cores variant.

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: set up JDK 17
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: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: gradle
- name: Setup Rust ARM target
- name: Set up Rust ARM target
run: rustup update && rustup target add aarch64-linux-android && rustup target add x86_64-linux-android
- name: AVD cache
uses: actions/cache@v4
Expand All @@ -121,13 +121,13 @@ jobs:
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # [email protected]
with:
channel: beta
channel: stable
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the clue of the change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dang I wonder why were using beta

force-avd-creation: false
api-level: 21
target: default
ram-size: 2048M
arch: x86_64
disk-size: 4096M
disk-size: 6144M
profile: Nexus 6
disable-animations: true
emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Expand All @@ -141,13 +141,13 @@ jobs:
- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # [email protected]
with:
channel: beta
channel: stable
force-avd-creation: false
api-level: 21
target: default
ram-size: 2048M
arch: x86_64
disk-size: 4096M
disk-size: 6144M
profile: Nexus 6
disable-animations: true
emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Augustyniak marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -189,12 +189,12 @@ jobs:
timeout-minutes: 30
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b # pin@v2
with:
channel: beta
channel: stable
api-level: ${{ matrix.api-level }}
target: google_apis
ram-size: 2048M
arch: x86_64
disk-size: 4096M
disk-size: 6144M
profile: Nexus 6
emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: echo "Generated AVD snapshot for caching."
Expand All @@ -203,12 +203,12 @@ jobs:
timeout-minutes: 15
with:
force-avd-creation: false
channel: beta
channel: stable
api-level: ${{ matrix.api-level }}
target: google_apis
ram-size: 2048M
arch: x86_64
disk-size: 4096M
disk-size: 6144M
profile: Nexus 6
emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: ./ci/verify_android.sh
Expand All @@ -226,6 +226,4 @@ jobs:
with:
fetch-depth: 1
- name: check result
run: ./ci/check_result.sh ${{ needs.pre_check.result }} && ./ci/check_result.sh ${{ needs.build_apk.result }}
# TODO(snowp): Re-enable these checks once we fix the emulator issues
# && ./ci/check_result.sh ${{ needs.verify_android_hello_world_per_version.result }} && ./ci/check_result.sh ${{ needs.gradle_tests.result }}
run: ./ci/check_result.sh ${{ needs.pre_check.result }} && ./ci/check_result.sh ${{ needs.build_apk.result }} && ./ci/check_result.sh ${{ needs.verify_android_hello_world_per_version.result }} && ./ci/check_result.sh ${{ needs.gradle_tests.result }}
Loading