Build/Test Tools: Backport updates to GitHub Actions.

This backports updates to GitHub Actions workflows required to address deprecated notices related to `save-output` and `set-output`.

Merges [54650], [54750], [54851], [54852], [54856], and [55152] to the 6.1 branch.
See #56882, #56820.

git-svn-id: https://develop.svn.wordpress.org/branches/6.1@55357 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2023-02-17 07:51:16 +00:00
parent a8fd670237
commit 73f7aa4a14
9 changed files with 167 additions and 218 deletions

View File

@ -21,7 +21,7 @@ on:
# Any change to a PHP or JavaScript file should run checks.
- '**.js'
- '**.php'
# These files configure NPM. Changes could affect the outcome.
# These files configure npm. Changes could affect the outcome.
- 'package*.json'
# These files configure Composer. Changes could affect the outcome.
- 'composer.*'
@ -48,13 +48,13 @@ jobs:
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP.
# - Logs debug information.
# - Configures caching for PHPCS scans.
# - Installs Composer dependencies (use cache if possible).
# - Installs Composer dependencies.
# - Make Composer packages available globally.
# - Logs PHP_CodeSniffer debug information.
# - Runs PHPCS on the full codebase with warnings suppressed.
# - Generate a report for displaying issues as pull request annotations.
# - Runs PHPCS on the `tests` directory without warnings suppressed.
# - Generate a report for displaying `test` directory issues as pull request annotations.
# - Ensures version-controlled files are not modified or deleted.
phpcs:
name: PHP coding standards
@ -64,19 +64,14 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up PHP
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
with:
php-version: '7.4'
coverage: none
tools: composer, cs2pr
- name: Log debug information
run: |
php --version
composer --version
tools: cs2pr
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
# http://man7.org/linux/man-pages/man1/date.1.html
@ -85,22 +80,21 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
- name: Cache PHPCS scan cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
with:
path: .cache/phpcs.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
composer-options: "--no-progress --no-ansi"
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
- name: Make Composer packages available globally
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
- name: Log PHPCS debug information
run: phpcs -i
- name: Run PHPCS on all Core files
id: phpcs-core
run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml
@ -126,10 +120,9 @@ jobs:
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# - Logs updated debug information.
# _ Installs NPM dependencies.
# - Installs npm dependencies.
# - Run the WordPress JSHint checks.
# - Ensures version-controlled files are not modified or deleted.
jshint:
@ -142,17 +135,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
@ -161,8 +147,10 @@ jobs:
run: |
npm --version
node --version
git --version
svn --version
- name: Install Dependencies
- name: Install npm Dependencies
run: npm ci
- name: Run JSHint
@ -200,7 +188,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -35,12 +35,11 @@ jobs:
# Performs the following steps:
# - Sets environment variables.
# - Checks out the repository.
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# _ Installs NPM dependencies.
# - Installs npm dependencies.
# - Builds WordPress to run from the `build` directory.
# - Starts the WordPress Docker container.
# - Logs general debug information.
# - Logs the running Docker containers.
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
# - Install WordPress within the Docker container.
@ -59,7 +58,13 @@ jobs:
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Log debug information
run: |
@ -68,17 +73,9 @@ jobs:
curl --version
git --version
svn --version
php --version
php -i
locale -a
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install Dependencies
- name: Install npm Dependencies
run: npm ci
- name: Build WordPress
@ -88,14 +85,6 @@ jobs:
run: |
npm run env:start
- name: General debug information
run: |
npm --version
node --version
curl --version
git --version
svn --version
- name: Log running Docker containers
run: docker ps -a
@ -146,7 +135,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -24,7 +24,7 @@ jobs:
steps:
- name: Rerun a workflow
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -19,7 +19,7 @@ on:
paths:
# Any change to a JavaScript file should run tests.
- '**.js'
# These files configure NPM. Changes could affect the outcome.
# These files configure npm. Changes could affect the outcome.
- 'package*.json'
# This file configures ESLint. Changes could affect the outcome.
- '.eslintignore'
@ -43,10 +43,9 @@ jobs:
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# - Logs updated debug information.
# _ Installs NPM dependencies.
# - Installs npm dependencies.
# - Run the WordPress QUnit tests.
# - Ensures version-controlled files are not modified or deleted.
test-js:
@ -57,17 +56,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
@ -76,8 +68,10 @@ jobs:
run: |
npm --version
node --version
git --version
svn --version
- name: Install Dependencies
- name: Install npm Dependencies
run: npm ci
- name: Run QUnit tests
@ -114,7 +108,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -46,10 +46,10 @@ jobs:
# - Sets up PHP.
# - Logs debug information.
# - Configures caching for PHP compatibility scans.
# - Installs Composer dependencies (use cache if possible).
# - Installs Composer dependencies.
# - Make Composer packages available globally.
# - Logs PHP_CodeSniffer debug information.
# - Runs the PHP compatibility tests.
# - Generate a report for displaying issues as pull request annotations.
# - Ensures version-controlled files are not modified or deleted.
php-compatibility:
name: Check PHP compatibility
@ -59,18 +59,17 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up PHP
uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 # v2.21.2
uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
with:
php-version: '7.4'
coverage: none
tools: composer, cs2pr
tools: cs2pr
- name: Log debug information
run: |
php --version
composer --version
# This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
@ -80,22 +79,21 @@ jobs:
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
- name: Cache PHP compatibility scan cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
with:
path: .cache/phpcompat.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
composer-options: "--no-progress --no-ansi"
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
- name: Make Composer packages available globally
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
- name: Log PHPCS debug information
run: phpcs -i
- name: Run PHP compatibility tests
id: phpcs
run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
@ -135,7 +133,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -36,22 +36,20 @@ jobs:
#
# Performs the following steps:
# - Sets environment variables.
# - Sets up the environment variables needed for testing with memcached (if desired).
# - Installs NodeJS.
# - Installs NPM dependencies
# - Configures caching for Composer.
# - Checks out the repository.
# - Sets up Node.js.
# - Sets up PHP.
# - Installs Composer dependencies.
# - Installs npm dependencies
# - Logs general debug information about the runner.
# - Logs Docker debug information (about the Docker installation within the runner).
# - Starts the WordPress Docker container.
# - Logs general debug information about the runner.
# - Logs the running Docker containers.
# - Logs debug information from inside the WordPress Docker container.
# - Logs debug information about what's installed within the WordPress Docker containers.
# - Install WordPress within the Docker container.
# - Run the PHPUnit tests.
# - Ensures version-controlled files are not modified or deleted.
# - Checks out the WordPress Test reporter repository.
# - Reconnect the directory to the Git repository.
# - Submit the test results to the WordPress.org host test results.
test-php:
name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
@ -106,45 +104,46 @@ jobs:
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install Dependencies
##
# This allows Composer dependencies to be installed using a single step.
#
# Since the tests are currently run within the Docker containers where the PHP version varies,
# the same PHP version needs to be configured for the action runner machine so that the correct
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
with:
php-version: '${{ matrix.php }}'
coverage: none
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
- name: Install npm dependencies
run: npm ci
# This date is used to ensure that the Composer cache is refreshed at least once every week.
# http://man7.org/linux/man-pages/man1/date.1.html
- name: "Get last Monday's date"
id: get-date
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
- name: Get Composer cache directory
id: composer-cache
run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.composer_dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }}
- name: Install Composer dependencies
- name: General debug information
run: |
docker-compose run --rm php composer --version
# Install using `composer update` as there is no `composer.lock` file.
if [ ${{ env.LOCAL_PHP }} == '8.2-fpm' ]; then
docker-compose run --rm php composer update --ignore-platform-req=php+
else
docker-compose run --rm php composer update
fi
npm --version
node --version
curl --version
git --version
svn --version
composer --version
locale -a
- name: Docker debug information
run: |
@ -155,14 +154,6 @@ jobs:
run: |
npm run env:start
- name: General debug information
run: |
npm --version
node --version
curl --version
git --version
svn --version
- name: Log running Docker containers
run: docker ps -a
@ -216,7 +207,7 @@ jobs:
- name: Checkout the WordPress Test Reporter
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
repository: 'WordPress/phpunit-test-runner'
path: 'test-runner'
@ -255,7 +246,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -53,7 +53,7 @@ jobs:
steps:
- name: Determine the status of the previous attempt
id: previous-attempt-result
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418
@ -118,7 +118,7 @@ jobs:
- name: Get the commit message
id: current-commit-message
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
with:
retries: 2

View File

@ -32,26 +32,25 @@ env:
LOCAL_PHP_MEMCACHED: ${{ false }}
jobs:
# Sets up WordPress for testing or development use.
# Runs the PHPUnit tests for WordPress.
#
# Performs the following steps:
# - Sets environment variables.
# - Checks out the repository.
# - Checks out the WordPress Importer plugin (needed for the Core PHPUnit tests).
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# _ Installs NPM dependencies.
# - Sets up Node.js.
# - Sets up PHP.
# - Installs Composer dependencies.
# - Installs npm dependencies
# - Logs general debug information about the runner.
# - Logs Docker debug information (about the Docker installation within the runner).
# - Starts the WordPress Docker container.
# - Logs debug general information.
# - Logs the running Docker containers.
# - Logs WordPress Docker container debug information.
# - Logs debug information about what's installed within the WordPress Docker containers.
# - Install WordPress within the Docker container.
# - Run the PHPUnit tests as a single site.
# - Ensures version-controlled files are not modified or deleted.
# - Upload the single site code coverage report to Codecov.io.
# - Run the PHPUnit tests as a multisite.
# - Run the PHPUnit tests as a multisite installation.
# - Ensures version-controlled files are not modified or deleted.
# - Upload the multisite code coverage report to Codecov.io.
test-coverage-report:
@ -71,7 +70,36 @@ jobs:
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
##
# This allows Composer dependencies to be installed using a single step.
#
# Since the tests are currently run within the Docker containers where the PHP version varies,
# the same PHP version needs to be configured for the action runner machine so that the correct
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
with:
php-version: '7.4'
coverage: none
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
- name: Install npm Dependencies
run: npm ci
- name: Log debug information
run: |
@ -82,44 +110,9 @@ jobs:
curl --version
git --version
svn --version
php --version
php -i
composer --version
locale -a
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install Dependencies
run: npm ci
# This date is used to ensure that the Composer cache is refreshed at least once every week.
# http://man7.org/linux/man-pages/man1/date.1.html
- name: "Get last Monday's date"
id: get-date
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
- name: Get Composer cache directory
id: composer-cache
run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.composer_dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }}
- name: Install Composer dependencies
run: |
docker-compose run --rm php composer --version
# Install using `composer update` as there is no `composer.lock` file.
docker-compose run --rm php composer update
- name: Docker debug information
run: |
docker -v
@ -129,14 +122,6 @@ jobs:
run: |
npm run env:start
- name: General debug information
run: |
npm --version
node --version
curl --version
git --version
svn --version
- name: Log running Docker containers
run: docker ps -a
@ -209,7 +194,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418

View File

@ -1,4 +1,4 @@
name: Test NPM
name: Test npm
on:
push:
@ -15,11 +15,11 @@ on:
- '3.[7-9]'
- '[4-9].[0-9]'
paths:
# These files configure NPM. Changes could affect the outcome.
# These files configure npm. Changes could affect the outcome.
- 'package*.json'
# JavaScript files are built using NPM.
# JavaScript files are built using npm.
- '**.js'
# CSS and SCSS files are built using NPM.
# CSS and SCSS files are built using npm.
- '**.scss'
- '**.css'
# Changes to workflow files should always verify all workflows are successful.
@ -37,13 +37,13 @@ env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
jobs:
# Verifies that installing NPM dependencies and building WordPress works as expected.
# 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 NodeJS.
# _ Installs NPM dependencies.
# - Installs npm dependencies.
# - Builds WordPress to run from the `build` directory.
# - Cleans up after building WordPress to the `build` directory.
# - Ensures version-controlled files are not modified or deleted.
@ -51,7 +51,7 @@ jobs:
# - Cleans up after building WordPress to the `src` directory.
# - Ensures version-controlled files are not modified or deleted.
test-npm:
name: Test NPM on ${{ matrix.os }}
name: Test npm on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
@ -62,7 +62,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Log debug information
run: |
@ -72,13 +78,7 @@ jobs:
git --version
svn --version
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install Dependencies
- name: Install npm Dependencies
run: npm ci
- name: Build WordPress in /src
@ -99,16 +99,20 @@ jobs:
- name: Ensure version-controlled files are not modified or deleted during building and cleaning
run: git diff --exit-code
# Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.
# Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
#
# This is separate from the job above in order to use stricter conditions about when to run.
# This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
#
# The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
# currently no way to determine the OS being used on a given job.
# See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# _ Installs NPM dependencies.
# - Installs npm dependencies.
# - Builds WordPress to run from the `build` directory.
# - Cleans up after building WordPress to the `build` directory.
# - Ensures version-controlled files are not modified or deleted.
@ -116,13 +120,19 @@ jobs:
# - Cleans up after building WordPress to the `src` directory.
# - Ensures version-controlled files are not modified or deleted.
test-npm-macos:
name: Test NPM on MacOS
name: Test npm on MacOS
runs-on: macos-latest
timeout-minutes: 30
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: Log debug information
run: |
@ -132,13 +142,7 @@ jobs:
git --version
svn --version
- name: Install NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm
- name: Install Dependencies
- name: Install npm Dependencies
run: npm ci
- name: Build WordPress in /src
@ -188,7 +192,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@100527700e8b29ca817ac0e0dfbfc5e8ff38edda # v6.3.2
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
with:
retries: 2
retry-exempt-status-codes: 418