Skip to content

Commit

Permalink
minimal node and npm upgrade (#53426)
Browse files Browse the repository at this point in the history
* minimal node and npm upgrade

* fix some ts errors

* The package-lock.json commit

---------

Co-authored-by: Jorge Costa <jorge.costa@developer.pt>
Co-authored-by: Noah Allen <noahtallen@gmail.com>
Co-authored-by: Kai Has <hi@kaihao.dev>
  • Loading branch information
4 people committed Aug 9, 2023
1 parent 0ebcee8 commit a3bef32
Show file tree
Hide file tree
Showing 16 changed files with 91,941 additions and 42,520 deletions.
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: ['16']
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
- 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: ['16']

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: ['16']

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
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
16
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

0 comments on commit a3bef32

Please sign in to comment.