-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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] Remove the template explosion in the CI via a matrix #15334
Conversation
Templates are being abused and is resulting in a tempalte explosion, this means that when the templates get expanded we have 100 thousans of lines generated. Azure devops has a limit in the size of the expanded template, and once that limit is reached, the pipeline wont be able to execute. This changes makes the problem go away since a matrix is a native object for azure pipelines and does not get expanded. This PR only takes care of the android emulator tests. A similar PR can be found in the xamarin-macios project: xamarin/xamarin-macios#18312
${{ replace(coalesce(project.desc, project.name), ' ', '_') }}_API_${{ api }}: | ||
${{ if ge(api, 24) }}: | ||
ANDROID_EMULATORS: "system-images;android-${{ api }};google_apis_playstore;x86" | ||
${{ if lt(api, 24) }}: |
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.
You could probably also use ${{ else }} here instead
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.
Agreed, but I tried to keep it as close as the original, will do in a second PR.
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.
Minor recommendation otherwise looks good
This PR is a continuation of #15334 the removes the exact same problem but with the iOS device tests rather than with the android tests. Uses the exact same approach, moves from using a template explosion to a matrix with the diff combinations.
* [CI] Remove the template explosion in the CI via a matrix This PR is a continuation of #15334 the removes the exact same problem but with the iOS device tests rather than with the android tests. Uses the exact same approach, moves from using a template explosion to a matrix with the diff combinations. * Lower case looks much better.
Templates are being abused and is resulting in a template explosion, this means that when the templates get expanded we have 100 thousans of lines generated. Azure devops has a limit in the size of the expanded template, and once that limit is reached, the pipeline wont be able to execute.
This changes makes the problem go away since a matrix is a native object for azure pipelines and does not get expanded.
This PR only takes care of the android emulator tests. A similar PR can be found in the xamarin-macios project:
xamarin/xamarin-macios#18312
For a better idea of what we achieve, the following is the expanded template: https://gist.github.com/mandel-macaque/dda3cda899e975814e563d6e34b50192
The following is the matrix expanded version: https://gist.github.com/mandel-macaque/ddbd66bbfb09531e866ee5b9354b8604
As you can see we go from 18850 yaml lines to 8210, that is over 10000 lines less. This reduces the time it takes for the pipeline to start as well as the effort to debug it.