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

Minimal node and npm upgrade #52363

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-block.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['14']
node: ['18']
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/end2end-test.yml
Expand Up @@ -41,8 +41,8 @@ jobs:

- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )

- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/performance.yml
Expand Up @@ -37,6 +37,13 @@ jobs:
- name: Setup Node.js and install dependencies
uses: ./.github/setup-node

- name: Install NVM
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm -v

youknowriad marked this conversation as resolved.
Show resolved Hide resolved
- name: Compare performance with trunk
if: github.event_name == 'pull_request'
run: ./bin/plugin/cli.js perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-automation.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
if: ${{ github.repository == 'WordPress/gutenberg' }}
strategy:
matrix:
node: ['14']
node: ['18']

steps:
# Checkout defaults to using the branch which triggered the event, which
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['14']
node: ['18']

steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
Expand Down
1 change: 1 addition & 0 deletions .npmrc
@@ -1,2 +1,3 @@
save-exact = true
engine-strict = true
legacy-peer-deps = true
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
14
18
4 changes: 2 additions & 2 deletions bin/plugin/commands/performance.js
Expand Up @@ -285,7 +285,7 @@ async function runPerformanceTests( branches, options ) {

log( ' >> Installing dependencies and building packages' );
await runShellScript(
'npm ci && node ./bin/packages/build.js',
'bash -c "source $HOME/.nvm/nvm.sh && nvm install && npm ci && node ./bin/packages/build.js"',
performanceTestDirectory
);
log( ' >> Creating the environment folders' );
Expand Down Expand Up @@ -321,7 +321,7 @@ async function runPerformanceTests( branches, options ) {

log( ` >> Building the ${ fancyBranch } branch` );
await runShellScript(
'npm ci && npm run prebuild:packages && node ./bin/packages/build.js && npx wp-scripts build',
'bash -c "source $HOME/.nvm/nvm.sh && nvm install && npm ci && npm run prebuild:packages && node ./bin/packages/build.js && npx wp-scripts build"',
buildPath
);

Expand Down
2 changes: 1 addition & 1 deletion bin/validate-package-lock.js
Expand Up @@ -20,7 +20,7 @@ const { red, yellow } = require( 'chalk' );
// @ts-ignore
const packageLock = require( '../package-lock' );

const dependencies = Object.entries( packageLock.dependencies );
const dependencies = Object.entries( packageLock.packages );
for ( const [ name, dependency ] of dependencies ) {
if ( dependency.resolved === false ) {
console.log(
Expand Down