mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-01-29 21:17:39 +00:00
This bumps the minimum required version of Node.js/npm from 16.19.1 and 8.19.3 to 20.10.0 and 10.2.3. Since 20.10.0 is the latest 20.x version of Node.js, the `check-latest` option has been enabled for `actions/setup-node` in GitHub Actions workflows. This performs an additional external call to the Node.js API confirming the latest version is installed on the runner for use. In testing, it seems that 20.10.0 was not consistently deployed to all runner machines in use. This should be removed in the near future when the version of Node.js is reliably above the new minimum requirement. The Gutenberg repository has also been updated to use the same values for `engines`. Props jorbin, joemcgill, swissspidy, benharri, dhrupo, flootr, gziolo, noahtallen. See #59663. git-svn-id: https://develop.svn.wordpress.org/trunk@57212 602fd350-edb4-49c9-b593-d223f7449a82
89 lines
3.2 KiB
YAML
89 lines
3.2 KiB
YAML
##
|
|
# A callable workflow that tests the WordPress Core build process.
|
|
##
|
|
name: Test the WordPress Build Process
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
os:
|
|
description: 'Operating system to run tests on'
|
|
required: false
|
|
type: 'string'
|
|
default: 'ubuntu-latest'
|
|
directory:
|
|
description: 'Directory to run WordPress from. Valid values are `src` or `build`'
|
|
required: false
|
|
type: 'string'
|
|
default: 'src'
|
|
|
|
env:
|
|
PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
|
|
|
|
jobs:
|
|
# Verifies that installing npm dependencies and building WordPress works as expected.
|
|
#
|
|
# Performs the following steps:
|
|
# - Checks out the repository.
|
|
# - Sets up Node.js.
|
|
# - Logs debug information about the GitHub Action runner.
|
|
# - Installs npm dependencies.
|
|
# - Builds WordPress to run from the desired location (src or build).
|
|
# - Ensures version-controlled files are not modified or deleted.
|
|
# - Creates a ZIP of the built WordPress files (when building to the build directory).
|
|
# - Cleans up after building WordPress.
|
|
# - Ensures version-controlled files are not modified or deleted.
|
|
# - Uploads the ZIP as a GitHub Actions artifact (when building to the build directory).
|
|
build-process-tests:
|
|
name: Core running from ${{ inputs.directory }} / ${{ inputs.os == 'macos-latest' && 'MacOS' || inputs.os == 'windows-latest' && 'Windows' || 'Linux' }}
|
|
runs-on: ${{ inputs.os }}
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
with:
|
|
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
check-latest: true
|
|
cache: npm
|
|
|
|
- name: Log debug information
|
|
run: |
|
|
npm --version
|
|
node --version
|
|
curl --version
|
|
git --version
|
|
svn --version
|
|
|
|
- name: Install npm Dependencies
|
|
run: npm ci
|
|
|
|
- name: Build WordPress to run from ${{ inputs.directory }}
|
|
run: npm run build${{ inputs.directory == 'src' && ':dev' || '' }}
|
|
|
|
- name: Ensure version-controlled files are not modified or deleted during building
|
|
run: git diff --exit-code
|
|
|
|
- name: Create ZIP of built files
|
|
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
|
|
run: zip -r wordpress.zip build/.
|
|
|
|
- name: Clean after building to run from ${{ inputs.directory }}
|
|
run: npm run grunt clean${{ inputs.directory == 'src' && ' -- --dev' || '' }}
|
|
|
|
- name: Ensure version-controlled files are not modified or deleted during cleaning
|
|
run: git diff --exit-code
|
|
|
|
- name: Upload ZIP as a GitHub Actions artifact
|
|
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
|
|
if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }}
|
|
with:
|
|
name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
|
|
path: wordpress.zip
|
|
if-no-files-found: error
|