-
Notifications
You must be signed in to change notification settings - Fork 110
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
ci emulator: Cache AVD emulator setup to speed up repeated jobs #202
Conversation
arch: x86_64 | ||
# the `googleapis` emulator target is considerably slower on CI. | ||
target: default | ||
profile: Nexus 6 | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
force-avd-creation: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Gordon-F the example in their readme also sets force-avd-creation
to false
. That seems like a sensible default so perhaps we shouldn't even set this at all. I don't mind it not creating an avd
when it already exists, though that is extremely unlikely/impossible unless GH actions environment starts to ship with one...
@@ -94,31 +94,63 @@ jobs: | |||
strategy: | |||
matrix: | |||
source_os: [ubuntu-latest, windows-latest, local] | |||
env: | |||
api-level: 29 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be great to make arch
, profile
and target
part of env
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't expect these to change as often as the api-level
(which is also at least used in 3 places, the rest is only dereferenced twice), but it's indeed useful to deduplicate at least emulator-options
which is a rather "complicated" string.
I really, really with GH starts supporting YAML anchors, it would have made this 100x better:
https://github.com/MarijnS95/android-ndk-rs/actions/runs/1494051637/workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't expect these to change as often as the api-level
Maybe we should make api-level
part of matrix? At least min_sdk_version
and target_sdk_version
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess now that we have this cache it's probably worth running it that many times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try :) But, probably, after we make sure that the CI is stable enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, we'll probably need to come up with a more interesting test/example too. All these versions do is limit API available at compile vs build time, and that's really only interesting if that API is actually used.
Otherwise the only thing we're checking is if the resulting APK is still compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's land such a change after the CI is stable like this (and it looks like it is already) - note that the examples default to min_sdk_version=16
.
Our CI currently builds and runs the emulator three times, once for every possible APK source. It is possible to speed up this setup by only building the image once as per [1] and storing it using GitHub's cache system. [1]: https://github.com/ReactiveCircus/android-emulator-runner#usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Our CI currently builds and runs the emulator three times, once for every possible APK source. It is possible to speed up this setup by only building the image once as per 1 and storing it using GitHub's cache system. This approach was suggested in #133 (comment).
CC @Gordon-F for the suggestion!