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

GitHub actions workflows that use trunk branch fail when using npm version 7.6.0 #29528

Open
fluiddot opened this issue Mar 3, 2021 · 3 comments
Labels
[Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling

Comments

@fluiddot
Copy link
Contributor

fluiddot commented Mar 3, 2021

Description

When using npm version 7.6.0 in the workflows Compressed Size / Check (pull_request) and Performances Tests / Run performance tests (pull_request), we checkout trunk but due to the recent changes limiting the version of npm to v6, the processes fails.

Step-by-step reproduction instructions

  1. Create a test branch
  2. Install npm version 7.6.0
  3. Remove <7 condition from the npm engine section of package.json file (example)
  4. Run npm install
  5. Add the following code to a GitHub actions workflow that uses trunk branch (like Compressed Size):
    - name: Use Node.js 14.x
      uses: actions/setup-node@v1
      with:
        node-version: 14.x

    - name: Install latest NPM version
      run: npm install -g [email protected]

The code has to be placed after the checkout and npm cache restore, here is an example.
5. Push the changes
6. Create a test PR
7. Observe that the modified workflow is failing

Expected behaviour

GitHub actions workflows that use trunk branch should succeed.

Actual behaviour

GitHub actions workflows that use trunk branch fail.

Screenshots or screen recording (optional)

N/A

Code snippet (optional)

WordPress information

  • WordPress version: N/A
  • Gutenberg version: 10.0.1
  • Are all plugins except Gutenberg deactivated? N/A
  • Are you using a default theme (e.g. Twenty Twenty-One)? N/A

Device information

  • Device: N/A
  • Operating system: N/A
  • Browser: N/A
@fluiddot fluiddot added [Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling labels Mar 3, 2021
@ockham
Copy link
Contributor

ockham commented Mar 3, 2021

This one can be simply fixed by

diff --git a/package.json b/package.json
index 3c75522414..f3c07a917c 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
        },
        "engines": {
                "node": ">=10.0.0",
-               "npm": ">=6.9.0 <7"
+               "npm": ">=6.9.0"
        },
        "config": {
                "GUTENBERG_PHASE": 2,

or, if we prefer,

diff --git a/package.json b/package.json
index 3c75522414..dcbe81d1c2 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
        },
        "engines": {
                "node": ">=10.0.0",
-               "npm": ">=6.9.0 <7"
+               "npm": ">=7.6.0"
        },
        "config": {
                "GUTENBERG_PHASE": 2,

, right?

It's just that we can't do that yet because of #29524 and #29527, right?

@fluiddot fluiddot changed the title GitHub actions workflows that use master branch fail when using npm version 7.6.0 GitHub actions workflows that use trunk branch fail when using npm version 7.6.0 Mar 4, 2021
@fluiddot
Copy link
Contributor Author

fluiddot commented Mar 4, 2021

Yeah, this could be easily fixed just by changing the npm engine value as you commented.

The only thing to keep in mind is that we would need to merge this change into trunk branch first so the PR checks of "Update lock file format version to version 2 (NPM 7)" PR pass.

@Mamaduka
Copy link
Member

Engines update would be nice.

Currently can't install dependencies on Apple Silicon machines because of this restriction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

No branches or pull requests

3 participants