chore: Cache node installed via nvm on Bitrise #12271
Merged
+11
−0
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 PR adds steps to the
prep_environment
workflow for both restoring and saving the installed version of node. First, we attempt to restore the cached node file path. Then the install nvm step will attempt to install node if it doesn't exist. If it does, it will use the cached version of node. Then, we cache the downloaded version of node (if there is one)At the time of writing, node is installed to the following paths
/Users/vagrant/.nvm
/root/.nvm
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2029
Manual testing steps
pr_smoke_e2e_pipeline
Restore Node
step inprep_environment
workflow should not have any node to cacheSave Node
step will then cache nodepr_smoke_e2e_pipeline
again,Restore Node
will now be able to restore the cached version of nodeScreenshots/Recordings
Before
After
Build with node cache enabled - https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6598b4fb-e88a-4252-9d57-5e8421226ea5?tab=workflows
In this build, both
ios_e2e_build
andandroid_e2e_build
does not yet have node cached, so it downloads it on the respective machines and then caches it. For E2E tests - The restore node step successfully detects that node already exists via nvm and uses that instead of downloading it againPre-merge author checklist
Pre-merge reviewer checklist