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

allow multiple targets #72

Closed
yigit opened this issue Jun 14, 2020 · 6 comments
Closed

allow multiple targets #72

yigit opened this issue Jun 14, 2020 · 6 comments

Comments

@yigit
Copy link

yigit commented Jun 14, 2020

It would be really nice if I could set multiple targets in 1 action.
It is possible to do w/ matrix build but when the build itself is large, running it in parallel is not great. (lots of repeated builds)

I've tried executing multiple actions but second one fails when it tries to download the command line tools:

https://github.com/ReactiveCircus/android-emulator-runner/blob/master/src/sdk-installer.ts#L16

(mkdir fails since it already exists).

I'm looking for something like this:

- name: Run Integration Tests
      uses: ReactiveCircus/[email protected]
      with:
        api-levels: [21, 24, 26, 29] 
        arch: x86_64
        script: ./gradlew connectedCheck --stacktrace

It could be even better if it invoked all emulators at once but that might overload the CI so it is fine if each one runs 1 by 1. The whole goal here is to avoid the preliminary build steps.

A possible workaround is to build the apk in 1 job and depend on its apk output in another job and run it via adb but that is also quite custom and invoking the test via gradle is still preferable.

@ychescale9
Copy link
Member

I've tried executing multiple actions but second one fails when it tries to download the command line tools:

Could you share snippet of your workflow with which you run into this issue? AFAIK the cmdline-tools directory doesn't exist on the VMs yet. Or have you created that directory manually in an earlier step?

As for running tests on multiple emulator instances in a single job, is the goal to save the time spent on assembling the apk and test apk? With build matrix and parallel jobs, though the assembleXxx tasks etc are repeated in multiple jobs, they all run in parallel. So I'm not able to see the benefits of running the assemble tasks once in 1 job.

I also doubt we'll have much success running multiple instances of emulators in the background. If we had to launch 1 emulator -> run the script -> kill emulator -> start next emulator -> run script again -> kill emulator .... it has to be order of magnitude slower than using build matrix.

Maybe I'm missing some context here, so if you're able to share your high-level workflow setup / goals that'd be great!

@ychescale9
Copy link
Member

Oh I think I know what your tried to do now:

- name: run tests on API 21
      uses: reactivecircus/android-emulator-runner@v2
      with:
        api-level: 21
- name: run tests on API 24
      uses: reactivecircus/android-emulator-runner@v2
      with:
        api-level: 24
- name: run tests on API 26
      uses: reactivecircus/android-emulator-runner@v2
      with:
        api-level: 26
- name: run tests on API 29
      uses: reactivecircus/android-emulator-runner@v2
      with:
        api-level: 29

Yeah I haven't tested this scenario at all (and I'll fix that mkdir issue).

With this setup the assembleXxx tasks in subsequent jobs would be UP-TO-DATE, but do you have something that forces you to run these in a single build such that you don't care if they are not as fast as they can be?

@yigit
Copy link
Author

yigit commented Jun 15, 2020

yea this is what i've tried:

https://github.com/yigit/kotlin-sqlite-bindings/actions/runs/135170355/workflow#L74

And this is why i thought about doing it initially:

https://github.com/yigit/kotlin-sqlite-bindings/runs/770201597?check_suite_focus=true
https://pipelines.actions.githubusercontent.com/xe2Ksbrt7nJdzWUmvoDmI0Q6xhCpYHdnudCktrfeWLTsNoYJLz/_apis/pipelines/1/runs/102/signedlogcontent/5?urlExpires=2020-06-15T15%3A54%3A23.9483363Z&urlSigningMethod=HMACV1&urlSignature=bl1dugJTCsBkSmc%2BD5Wkdgcl0ezOG8%2Fz8AEVagyJzXM%3D

(couldn't find a runner)

Running them in parallel is definitely faster in total completion time. That being said, this project compiles kotlin native etc so getting konan artifacts & building takes considerable time hence I thought it is much better to just do it on 1 machine. Even though it will take longer, it will consume much less resources.

@ychescale9
Copy link
Member

Ok let me fix #73 first so your original setup (sequential jobs) works. Then I'll look at the feasibility of running multiple emulator instances in 1 job.

BTW looks like your second link has expired.

@ychescale9
Copy link
Member

Running multiple actions sequentially in a single job is now supported in v2.11.0. Let me know if it works for you 😃 .

@mrk-han
Copy link
Collaborator

mrk-han commented Nov 2, 2022

Closing per #73

@mrk-han mrk-han closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants