Malinskiy / action-android

Collection of Android-related GitHub Actions
MIT License
185 stars 24 forks source link

Using 0.1.4 on Apple Silicon M1 crashes [temporary solved] #70

Open hannesa2 opened 2 years ago

hannesa2 commented 2 years ago

Thanks to 0.1.3 I come one step closer to run on Apple Silicon M1, but now it crashes https://github.com/hannesa2/CVScanner/runs/7462427093?check_suite_focus=true

with this pull request https://github.com/hannesa2/CVScanner/pull/225/files

image

Any idea ?

hannesa2 commented 1 year ago

Now I use 0.1.4 and I see here https://github.com/hannesa2/CVScanner/actions/runs/4664538312/jobs/8256885338 this

image
Malinskiy commented 1 year ago

FYI, this action is not for self-hosted setups and clearly states the desired runner to be x86. M1 is not supported by public GH runners, when this public support will land https://github.com/github/roadmap/issues/528 (around Q4 2023 at this moment) then I might be able to verify what's happening with M1.

hannesa2 commented 1 year ago

Ok, Ive to accept your point of view. Just to let you know: On my custom M1 runner I see

/Users/hannes/android-sdk/cmdline-tools/bootstrap-version/bin/sdkmanager --version
3.0 

It shows me an old version. It looks like you use an outdated version. Local, on my M1 I see 10.0-beta04

hannesa2 commented 1 year ago

I see you use 3.0 from here https://github.com/Malinskiy/action-android/blob/2e4591be80bdbe897c601bd89046582f28e7d603/emulator-run-cmd/src/sdk.ts#L177 I guess it's a version from pre-M1-release.

Btw, the recent version to download is https://dl.google.com/android/repository/commandlinetools-mac-9477386_latest.zip

image
hannesa2 commented 1 year ago

YES ! I made it work to have a build with Android emulator on an Apple silicon M1 runner 🎉 https://github.com/hannesa2/paho.mqtt.android/pull/449 or https://github.com/hannesa2/CVScanner/actions/runs/4818113303/jobs/8579658690 Simply use

      - name: Install Android SDK
        uses: hannesa2/action-android/emulator-run-cmd@0.1.4.10

instead of

      - name: Install Android SDK
        uses: malinskiy/action-android/emulator-run-cmd@release/0.1.4

Now I've super fast espresso tests, please keep your attention on run time

image image
hannesa2 commented 1 year ago

Btw, now I've a full automated release pipeline, with auto generated changelog (when you make pull requests) https://github.com/hannesa2/action-android-M1/releases/tag/0.1.16.7

hannesa2 commented 5 months ago

FYI, this action is not for self-hosted setups and clearly states the desired runner to be x86. M1 is not supported by public GH runners, when this public support will land github/roadmap#528 (around Q4 2023 at this moment) then I might be able to verify what's happening with M1.

The public macOS-14 is an arm64 runner, which comes with HVF error: HV_UNSUPPORTED

https://github.com/ReactiveCircus/android-emulator-runner/issues/350 https://github.com/actions/runner-images/issues/9924#issuecomment-2160177759

For me , the only free solution is to run an self hosted M1 runner, but this can't run it malinskiy/action-android/install-sdk@release/0.1.6

bu my fork https://github.com/hannesa2/action-android-M1/releases/tag/0.1.16.7 hannesa2/action-android/install-sdk@release/0.1.16.7 works perfect for me

Malinskiy commented 5 months ago

The free option is to use public ubuntu runners with kvm enabled

hannesa2 commented 5 months ago

The free option is to use public ubuntu runners with kvm enabled

It's not an option, if you need an arm64. Btw ubuntu runner are super slow https://github.com/Malinskiy/action-android/issues/70#issuecomment-1525279983

Malinskiy commented 5 months ago

Latest versions of Ubuntu runners are really close to workstation-level performance.

Your alternative to a real free solution requires at least 600usd for a base model with 8gb ram and 1300usd realistically for the 16gb version. As mentioned before, this action is for users who want to use free infrastructure provided by github. If you want to help maintain this action for commercial setups where users can but their own hardware, then I'm happy to add you as a maintainer.

Cheers

hannesa2 commented 5 months ago

this action for commercial setups

This is not commercial ! I never wrote about costs, just about limitation of current state. The costs can everyone decide by himself. You could also use your own fast private development Mac as a runner as well. That's free !

Btw, you'll get a free arm64 runner from macstadium for open source projects, if you fulfill requirements