Skip to content

Test Core against additional versions of Node.js (just Core build process) #9399

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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/reusable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
required: false
type: 'string'
default: 'ubuntu-24.04'
node-version:
description: 'The Node.js version to use (22, 20, etc.). Leave blank to use the version specified in .nvmrc.'
required: false
type: 'string'
default: ''
directory:
description: 'Directory to run WordPress from. Valid values are `src` or `build`'
required: false
Expand Down Expand Up @@ -56,7 +61,7 @@ jobs:
# - Saves the pull request number to a text file.
# - Uploads the pull request number as an artifact.
build-process-tests:
name: Core running from ${{ inputs.directory }} / ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
name: Core running from ${{ inputs.directory }} / ${{ inputs.node-version == '' && 'Default Node.js' || format( 'Node.js {0}', inputs.node-version ) }} ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
permissions:
contents: read
runs-on: ${{ inputs.os }}
Expand All @@ -72,7 +77,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: '.nvmrc'
node-version: ${{ inputs.node-version }}
node-version-file: ${{ inputs.node-version == '' && '.nvmrc' || '' }}
cache: npm

- name: Log debug information
Expand Down Expand Up @@ -109,7 +115,7 @@ jobs:

- name: Upload ZIP as a GitHub Actions artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ inputs.save-build || inputs.prepare-playground }}
if: ${{ ( inputs.save-build || inputs.prepare-playground ) && inputs.node-version == '' }}
with:
name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
path: wordpress.zip
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/reusable-test-gutenberg-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
required: false
type: 'string'
default: 'ubuntu-24.04'
node-version:
description: 'The Node.js version to use (22, 20, etc.). Leave blank to use the version specified in .nvmrc.'
required: false
type: 'string'
default: ''
directory:
description: 'Directory to run WordPress from. Valid values are `src` or `build`'
required: false
Expand Down Expand Up @@ -41,7 +46,7 @@ jobs:
# - Builds Gutenberg.
# - Ensures version-controlled files are not modified or deleted.
build-process-tests:
name: Gutenberg running from ${{ inputs.directory }} / ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
name: Gutenberg running from ${{ inputs.directory }} / ${{ inputs.node-version == '' && 'Default Node.js' || format( 'Node.js {0}', inputs.node-version ) }} ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }}
permissions:
contents: read
runs-on: ${{ inputs.os }}
Expand All @@ -65,7 +70,8 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version-file: '.nvmrc'
node-version: ${{ inputs.node-version }}
node-version-file: ${{ inputs.node-version == '' && '.nvmrc' || '' }}
cache: npm
cache-dependency-path: |
package-lock.json
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/test-build-processes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,33 @@ jobs:
os: ${{ matrix.os }}
directory: ${{ matrix.directory }}

# Tests the WordPress Core build process on additional Node.js versions.
#
# Testing against additional Node.js versions can help spot potential issues as they are introduced.
test-core-build-process-additional-node-versions:
name: Core running from ${{ matrix.directory }}
uses: ./.github/workflows/reusable-test-core-build-process.yml
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04', 'macos-14', 'windows-2022' ]
node-version: [ '22', '24' ]
directory: [ 'src', 'build' ]
with:
os: ${{ matrix.os }}
node-version: ${{ matrix.node-version }}
directory: ${{ matrix.directory }}

slack-notifications:
name: Slack Notifications
uses: ./.github/workflows/slack-notifications.yml
permissions:
actions: read
contents: read
needs: [ test-core-build-process, test-core-build-process-additional-os, test-gutenberg-build-process, test-gutenberg-build-process-additional-os ]
needs: [ test-core-build-process, test-core-build-process-additional-os, test-gutenberg-build-process, test-gutenberg-build-process-additional-os, test-core-build-process-additional-node-versions ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
Expand Down