android-emulator-runner icon indicating copy to clipboard operation
android-emulator-runner copied to clipboard

Possibility to exclude installation of Android SDK?

Open TimJonsson opened this issue 3 years ago • 5 comments

Hello, I'm running this action on a self hosted runner where sudo commands are not allowed. I think this is causing my action to fail on the install Android SDK step, even if I'm setting up the SDK beforehand via this action

Install Android SDK
  /usr/bin/sh -c \sudo chown $USER:$USER /home/runner/.android/sdk -R
  sudo: unable to stat /etc/sudoers: No such file or directory
  sudo: no valid sudoers sources found, quitting
  sudo: unable to initialize policy plugin
Terminate Emulator
  /home/runner/.android/sdk/platform-tools/adb -s emulator-55[54](https://github.com/easyparkgroup/ep-android/actions/runs/3531604917/jobs/5924959465#step:6:56) emu kill
  error: could not connect to TCP port [55](https://github.com/easyparkgroup/ep-android/actions/runs/3531604917/jobs/5924959465#step:6:57)54: Cannot assign requested address
  The process '/home/runner/.android/sdk/platform-tools/adb' failed with exit code 1
Error: The process '/usr/bin/sh' failed with exit code 1

Is it possible to exclude the install android SDK step in this action, or any idea how I can fix my issue? Thank you!

TimJonsson avatar Nov 23 '22 13:11 TimJonsson

For the record I solved my problem by just building the apks on my self hosted runner, saved them as artifacts and used the artifacts in a new job using this action. Took the build time down from 80 min -> 13 min.

TimJonsson avatar Jan 02 '23 15:01 TimJonsson

@TimJonsson I want to implement a similar solution. Can you share your workflow please?

shankarRaman avatar Feb 07 '23 20:02 shankarRaman

@TimJonsson Did you work around the sudo issue by running everything on your own self-hosted runner (that allows sudo)? I see how building on your own runners would help cut down on the total build time, but I'm not sure how the rest of your solution here fell into place

erawhctim avatar Jul 24 '23 22:07 erawhctim

@shankarRaman @erawhctim Not able to share the workflow but basically yes. In my workflow I used two jobs. One job for building the apks on my self hosted runner, saving the apks using actions/upload-artifact@v3. Then another job using ubunut-latest downloading the apks using actions/download-artifact@v3 and then running the tests on these apks using the android-emulator-runner action.

TimJonsson avatar Sep 15 '23 09:09 TimJonsson

@TimJonsson were you running your jobs on a non-Mac self hosted runner?

shankarRaman avatar Sep 18 '23 18:09 shankarRaman