Skip to content

Commit 67ca5f3

Browse files
authored
Merge branch 'trunk' into update/excerpt-ellipsis
2 parents 564abcc + 3481fe8 commit 67ca5f3

File tree

592 files changed

+10645
-3754
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

592 files changed

+10645
-3754
lines changed

.github/setup-node/action.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Setup Node.js and install npm dependencies'
2+
description: 'Configure Node.js and install npm dependencies while managing all aspects of caching.'
3+
inputs:
4+
node-version:
5+
description: 'Optional. The Node.js version to use. When not specified, the version specified in .nvmrc will be used.'
6+
required: false
7+
type: string
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Use desired version of Node.js
13+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
14+
with:
15+
node-version-file: '.nvmrc'
16+
node-version: ${{ inputs.node-version }}
17+
cache: npm
18+
19+
- name: Get Node.js and npm version
20+
id: node-version
21+
run: |
22+
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
23+
shell: bash
24+
25+
- name: Cache node_modules
26+
id: cache-node_modules
27+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
28+
with:
29+
path: '**/node_modules'
30+
key: node_modules-${{ runner.os }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
31+
32+
- name: Install npm dependencies
33+
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
34+
run: npm ci
35+
shell: bash
36+
37+
# On cache hit, we run the post-install script to match the native `npm ci` behavior.
38+
# An example of this is to patch `node_modules` using patch-package.
39+
- name: Post-install
40+
if: ${{ steps.cache-node_modules.outputs.cache-hit == 'true' }}
41+
run: |
42+
# Run the post-install script for the root project.
43+
npm run postinstall
44+
# Run the post-install scripts for workspaces.
45+
npx lerna run postinstall
46+
shell: bash

.github/workflows/build-plugin-zip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
with:
169169
ref: ${{ needs.bump-version.outputs.release_branch || github.ref }}
170170

171-
- name: Use desired version of NodeJS
171+
- name: Use desired version of Node.js
172172
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
173173
with:
174174
node-version-file: '.nvmrc'
@@ -326,7 +326,7 @@ jobs:
326326
git config user.name "Gutenberg Repository Automation"
327327
git config user.email gutenberg@wordpress.org
328328
329-
- name: Setup Node (for CLI)
329+
- name: Setup Node.js
330330
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
331331
with:
332332
node-version-file: 'main/.nvmrc'

.github/workflows/bundle-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
fetch-depth: 1
4343

44-
- name: Use desired version of NodeJS
44+
- name: Use desired version of Node.js
4545
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
4646
with:
4747
node-version-file: '.nvmrc'

.github/workflows/create-block.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,17 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
node: [14]
23+
node: ['14']
2424
os: [macos-latest, ubuntu-latest, windows-latest]
2525

2626
steps:
2727
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
2828

29-
- name: Use desired version of NodeJS
30-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
29+
- name: Setup Node.js and install dependencies
30+
uses: ./.github/setup-node
3131
with:
3232
node-version: ${{ matrix.node }}
33-
cache: npm
3433

35-
- name: npm install, build, format and lint
34+
- name: Create block
3635
shell: bash
37-
run: |
38-
npm ci
39-
bash ./bin/test-create-block.sh
36+
run: bash ./bin/test-create-block.sh

.github/workflows/end2end-test.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
3131

32-
- name: Use desired version of NodeJS
33-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
34-
with:
35-
node-version-file: '.nvmrc'
36-
cache: npm
32+
- name: Setup Node.js and install dependencies
33+
uses: ./.github/setup-node
3734

38-
- name: Npm install and build
39-
run: |
40-
npm ci
41-
npm run build
35+
- name: Npm build
36+
run: npm run build
4237

4338
- name: Install WordPress
4439
run: |
@@ -78,16 +73,11 @@ jobs:
7873
steps:
7974
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
8075

81-
- name: Use desired version of NodeJS
82-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
83-
with:
84-
node-version-file: '.nvmrc'
85-
cache: npm
76+
- name: Setup Node.js and install dependencies
77+
uses: ./.github/setup-node
8678

87-
- name: Npm install and build
88-
run: |
89-
npm ci
90-
npm run build
79+
- name: Npm build
80+
run: npm run build
9181

9282
- name: Install Playwright dependencies
9383
run: |
@@ -137,19 +127,14 @@ jobs:
137127
name: flaky-tests-report
138128
path: flaky-tests
139129

140-
- name: Use desired version of NodeJS
130+
- name: Setup Node.js and install dependencies
141131
if: ${{ steps.download_artifact.outcome == 'success' }}
142-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
143-
with:
144-
node-version-file: '.nvmrc'
145-
cache: npm
132+
uses: ./.github/setup-node
146133

147-
- name: Npm install and build
134+
- name: Npm build
148135
if: ${{ steps.download_artifact.outcome == 'success' }}
149136
# TODO: We don't have to build the entire project, just the action itself.
150-
run: |
151-
npm ci
152-
npm run build:packages
137+
run: npm run build:packages
153138

154139
- name: Report flaky tests
155140
if: ${{ steps.download_artifact.outcome == 'success' }}

.github/workflows/performance.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,8 @@ jobs:
3232
steps:
3333
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
3434

35-
- name: Use desired version of NodeJS
36-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
37-
with:
38-
node-version-file: '.nvmrc'
39-
cache: npm
40-
41-
- name: Npm install
42-
run: |
43-
npm ci
44-
45-
- name: Install specific versions of the themes used in tests
46-
run: |
47-
npm run wp-env start
48-
npm run wp-env -- run tests-cli "wp theme update twentytwentyone --version=1.7"
49-
npm run wp-env -- run tests-cli "wp theme update twentytwentythree --version=1.0"
50-
npm run wp-env stop
35+
- name: Setup Node.js and install dependencies
36+
uses: ./.github/setup-node
5137

5238
- name: Compare performance with trunk
5339
if: github.event_name == 'pull_request'

.github/workflows/publish-npm-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
git config user.name "Gutenberg Repository Automation"
5050
git config user.email gutenberg@wordpress.org
5151
52-
- name: Setup Node (for CLI)
52+
- name: Setup Node.js
5353
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
5454
with:
5555
node-version-file: 'main/.nvmrc'

.github/workflows/pull-request-automation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
with:
2020
ref: trunk
2121

22-
- name: Use desired version of NodeJS
22+
- name: Use desired version of Node.js
2323
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
2424
with:
2525
node-version: ${{ matrix.node }}
2626

2727
- name: Cache NPM packages
28-
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3.2.5
28+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
2929
with:
3030
# npm cache files are stored in `~/.npm` on Linux/macOS
3131
path: ~/.npm

.github/workflows/rnmobile-android-runner.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,14 @@ jobs:
3131
distribution: 'temurin'
3232
java-version: '11'
3333

34-
- name: Use desired version of NodeJS
35-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
36-
with:
37-
node-version-file: '.nvmrc'
38-
cache: npm
39-
40-
- run: npm ci
34+
- name: Setup Node.js and install dependencies
35+
uses: ./.github/setup-node
4136

4237
- name: Gradle cache
43-
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef # v2.3.3
38+
uses: gradle/gradle-build-action@6095a76664413da4c8c134ee32e8a8ae900f0f1f # v2.4.0
4439

4540
- name: AVD cache
46-
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3.2.5
41+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
4742
id: avd-cache
4843
with:
4944
path: |

.github/workflows/rnmobile-ios-runner.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,22 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
2727

28-
- name: Use desired version of NodeJS
29-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
30-
with:
31-
node-version-file: '.nvmrc'
32-
cache: npm
33-
34-
- run: npm ci
28+
- name: Setup Node.js and install dependencies
29+
uses: ./.github/setup-node
3530

3631
- name: Prepare build cache key
3732
run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt
3833

3934
- name: Restore build cache
40-
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3.2.5
35+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
4136
with:
4237
path: |
4338
packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
4439
packages/react-native-editor/ios/build/WDA
4540
key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }}
4641

4742
- name: Restore pods cache
48-
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3.2.5
43+
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
4944
with:
5045
path: |
5146
packages/react-native-editor/ios/Pods

0 commit comments

Comments
 (0)