Skip to content

gh-137242: Add Android CI job #137186

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

Merged
merged 18 commits into from
Aug 12, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use sudo when updating udev rules
  • Loading branch information
mhsmith committed Aug 9, 2025
commit c9700e47b6bf98f6ca2e60ecdbee15ba228dcc7c
17 changes: 7 additions & 10 deletions Android/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@ def clean_all(context):
def setup_ci():
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
if "GITHUB_ACTIONS" in os.environ and platform.system() == "Linux":
Path("/etc/udev/rules.d/99-kvm4all.rules").write_text(
'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n'
run(
["sudo", "tee", "/etc/udev/rules.d/99-kvm4all.rules"],
input='KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"\n',
text=True,
)
run(["sudo", "udevadm", "control", "--reload-rules"])
run(["sudo", "udevadm", "trigger", "--name-match=kvm"])
Expand Down Expand Up @@ -691,13 +693,8 @@ def package(context):

# Strip debug information.
if not context.debug:
run(
[
android_env(context.host)["STRIP"],
*glob(f"{temp_dir}/**/*.so", recursive=True),
],
log=False,
)
so_files = glob(f"{temp_dir}/**/*.so", recursive=True)
run([android_env(context.host)["STRIP"], *so_files], log=False)

dist_dir = subdir(context.host, "dist", create=True)
package_path = shutil.make_archive(
Expand Down Expand Up @@ -731,7 +728,7 @@ def ci(context):
and (platform.system(), platform.machine()) != ("Linux", "x86_64")
):
print(
"Skipping test: GitHub Actions does not supports the Android "
"Skipping tests: GitHub Actions does not support the Android "
"emulator on this platform."
)
else:
Expand Down
Loading