[example tests] Adding a clone and a deploy step to allow optimizations in CI. #3208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds an example clone and deploy step that allows you to modify
each top level repository before pulling in the rest of the example's
dependencies. This allows us to not pull in a copy of mbed-os for each
example in CI and instead symbolic link the already cloned copy, saving
valuable time and disk space
Status
READY
Migrations
If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.
NO
Todos
How to use
These changes are intended mostly for use in CI. Currently importing the examples and their dependencies (including mbed-os for every example) takes upwards of 10 minutes and multiple GBs of disk space. This will both reduce the time and disk space for testing with one common mbed-os revision by allowing you to symbolic link to one specific repository. The flow would look like the following.
cd examples
clone
command:python ../mbed-os/tools/examples/examples.py clone
git
orhg
command to clone just the top level example repoln -s ../../mbed-os mbed-os
or use the equivalent command on your OSdeploy
command to finish pulling in each examples' dependencies (in this case, mbed-os is already present so it is not cloned):python ../mbed-os/tools/examples/examples.py deploy
At this point, the examples are fully cloned. You can now use the rest of
examples.py
as you normally would.