Add keep-running option to keep the emulator running for subsequent steps#472
Open
takahirom wants to merge 2 commits into
Open
Add keep-running option to keep the emulator running for subsequent steps#472takahirom wants to merge 2 commits into
takahirom wants to merge 2 commits into
Conversation
Member
|
Thanks for the PR! I'll try to take a closer look next week, but if this works well I'd be keen to consider a v3 so we can remove the |
Author
|
FYI — I've prepared a follow-up on top of this PR that makes
Diff: takahirom/android-emulator-runner@keep-alive-option...keep-running-env-and-cleanup Happy to open it as a separate stacked PR once this one lands, or fold it into this PR if you'd prefer to review them together. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, and thanks for maintaining this action — it makes running Android emulators in CI painless. 🙏
Motivation: I'd like to boot the emulator once and then drive it from one or more later steps in the same job — in my case, running a separate tool against the booted emulator over
adb— instead of having to cram everything into this action's singlescript. That isn't possible today: the action always kills the emulator whenscriptfinishes, so the emulator never survives into the next step.What it does:
keep-running(defaultfalse— fully backward compatible).true, the action skipskillEmulatorand force-exits so the step finishes while the emulator keeps running. Theprocess.exit(process.exitCode ?? 0)is needed because the backgrounded emulator inherits the action's stdio, so without killing it the Node event loop never drains and the step hangs; the exit code is propagated so a failingscriptisn't masked as success. The error path still kills the emulator.Tests: added validator tests for
keep-running;npm testpasses.