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

chore: Cache node installed via nvm on Bitrise #12271

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

Cal-L
Copy link
Contributor

@Cal-L Cal-L commented Nov 13, 2024

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

  • iOS - /Users/vagrant/.nvm
  • Android - /root/.nvm

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/2029

Manual testing steps

  1. On Bitrise, run pr_smoke_e2e_pipeline
  2. On initial run, the Restore Node step in prep_environment workflow should not have any node to cache
  3. nvm will then install node
  4. The Save Node step will then cache node
  5. Upon re-running the pr_smoke_e2e_pipeline again, Restore Node will now be able to restore the cached version of node
  6. The nvm install step will then detect that a version exists and use the cached version

Screenshots/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 and android_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 again

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@Cal-L Cal-L requested review from a team as code owners November 13, 2024 02:12
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@Cal-L Cal-L added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) No QA Needed Apply this label when your PR does not need any QA effort. labels Nov 13, 2024
bitrise.yml Show resolved Hide resolved
bitrise.yml Show resolved Hide resolved
bitrise.yml Show resolved Hide resolved
bitrise.yml Show resolved Hide resolved
Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Cal-L Cal-L enabled auto-merge November 14, 2024 17:47
@Cal-L Cal-L added this pull request to the merge queue Nov 14, 2024
Merged via the queue into main with commit 3af74fb Nov 14, 2024
41 checks passed
@Cal-L Cal-L deleted the chore/2029-bitrise-cache-node branch November 14, 2024 18:01
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Nov 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2024
@metamaskbot metamaskbot added the release-7.36.0 Issue or pull request that will be included in release 7.36.0 label Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.36.0 Issue or pull request that will be included in release 7.36.0 team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants