Skip to content

Conversation

@rekmarks
Copy link
Member

This is a copy of MetaMask/metamask-module-template#246

A recent commit upgraded the version of Yarn to v4 and removed the Yarn binary from the repo, thereby requiring that Corepack be installed in order to install dependencies. The build-lint-test was updated to install Corepack, but not the documentation-related workflows, so they are failing.

This commit fixes those workflows to install Corepack. It also cleans up some work that was done in previous commits:

  • In the build-lint-test workflow we ensure that prepare is run once per Node version we are testing and that build and lint use the latest Node version we are testing.
  • In steps where we are installing Node just to gain access to the corepack executable, we use .nvmrc (the version of Node we use for development) to know which version of Node to install rather than using the latest LTS (lts/*). For jobs that do not need to concern themselves with being run in multiple Node versions, this ensures that consistent Node versions are used in this step vs. the step that is used to simply restore the Yarn cache.
  • The checkout step always goes first, this way .nvmrc can be read.

Examples

A recent commit upgraded the version of Yarn to v4 and removed the Yarn
binary from the repo, thereby requiring that Corepack be installed in
order to install dependencies. The `build-lint-test` was updated to
install Corepack, but not the documentation-related workflows, so they
are failing.

This commit fixes those workflows to install Corepack. It also cleans up
some work that was done in previous commits:

- In the `build-lint-test` workflow we ensure that `prepare` is run once
per Node version we are testing and that `build` and `lint` use the
latest Node version we are testing.
- In steps where we are installing Node just to gain access to the
`corepack` executable, we use `.nvmrc` (the version of Node we use for
development) to know which version of Node to install rather than using
the latest LTS (`lts/*`). For jobs that do not need to concern
themselves with being run in multiple Node versions, this ensures that
consistent Node versions are used in this step vs. the step that is used
to simply restore the Yarn cache.
- The checkout step always goes first, this way `.nvmrc` can be read.
@rekmarks rekmarks changed the title Fix other workflows to install Corepack as prereq fix: Install Corepack as prereq in broken workflows Jun 28, 2024
@rekmarks
Copy link
Member Author

Closing in favor of #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants