mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
Build/Test Tools: Backport updates to GitHub Actions.
This backports several changesets to GitHub Actions workflows. These changesets: - address the deprecated notices related to save-output and set-output to ensure the workflows continue to run after these are removed. - adds support for automatically retrying a failed workflow once. - removes workflow files that are not applicable to the branch. - backports some Docker environment related tooling updates for the sake of consistency across branches. Merges [53736], [53737], [53940], [53947], [54039], [54096], [54108], [54293], [54313], [54342], [54343], [54373], [54511], [54649], [54650], [54651], [54674], [54750], [54852], [55152], [55487] to the 5.6 branch. See #55652, #56407, #56528, #54695, #56820, #56816, #56793, #56820, #57572. git-svn-id: https://develop.svn.wordpress.org/branches/5.6@55519 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ae22da6517
commit
f34b8b24f2
4
.env
4
.env
@ -57,8 +57,8 @@ LOCAL_DB_TYPE=mysql
|
||||
#
|
||||
# Defaults to 5.7 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
|
||||
#
|
||||
# When using `mysql`, see https://hub.docker.com/_/mysql/ for valid versions.
|
||||
# When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
|
||||
# When using `mysql`, see https://hub.docker.com/r/amd64/mysql for valid versions.
|
||||
# When using `mariadb`, see https://hub.docker.com/r/amd64/mariadb for valid versions.
|
||||
##
|
||||
LOCAL_DB_VERSION=5.7
|
||||
|
||||
|
56
.github/workflows/coding-standards.yml
vendored
56
.github/workflows/coding-standards.yml
vendored
@ -9,8 +9,9 @@ on:
|
||||
- '3.[89]'
|
||||
- '[4-9].[0-9]'
|
||||
tags:
|
||||
- '3.[89]*'
|
||||
- '[4-9].[0-9]*'
|
||||
- '[0-9]+.[0-9]'
|
||||
- '[0-9]+.[0-9].[0-9]+'
|
||||
- '!3.7.[0-9]+'
|
||||
pull_request:
|
||||
branches:
|
||||
- trunk
|
||||
@ -20,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.*'
|
||||
@ -61,10 +62,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
|
||||
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
|
||||
with:
|
||||
php-version: '7.4'
|
||||
coverage: none
|
||||
@ -76,9 +77,9 @@ jobs:
|
||||
composer --version
|
||||
|
||||
- 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 --no-interaction"
|
||||
composer-options: "--no-progress --no-ansi"
|
||||
|
||||
- name: Make Composer packages available globally
|
||||
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
||||
@ -99,9 +100,9 @@ jobs:
|
||||
# Performs the following steps:
|
||||
# - Checks out the repository.
|
||||
# - Logs debug information about the GitHub Action runner.
|
||||
# - Installs NodeJS.
|
||||
# - Installs Node.js.
|
||||
# - Logs updated debug information.
|
||||
# _ Installs NPM dependencies.
|
||||
# _ Installs npm dependencies.
|
||||
# - Run the WordPress JSHint checks.
|
||||
jshint:
|
||||
name: JavaScript coding standards
|
||||
@ -113,7 +114,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Log debug information
|
||||
run: |
|
||||
@ -122,8 +123,8 @@ jobs:
|
||||
git --version
|
||||
svn --version
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: npm
|
||||
@ -151,3 +152,34 @@ jobs:
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
|
||||
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
|
||||
|
||||
failed-workflow:
|
||||
name: Failed workflow tasks
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ phpcs, jshint, slack-notifications ]
|
||||
if: |
|
||||
always() &&
|
||||
github.repository == 'WordPress/wordpress-develop' &&
|
||||
github.event_name != 'pull_request' &&
|
||||
github.run_attempt < 2 &&
|
||||
(
|
||||
needs.phpcs.result == 'cancelled' || needs.phpcs.result == 'failure' ||
|
||||
needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure'
|
||||
)
|
||||
|
||||
steps:
|
||||
- name: Dispatch workflow run
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
retries: 2
|
||||
retry-exempt-status-codes: 418
|
||||
script: |
|
||||
github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'failed-workflow.yml',
|
||||
ref: 'trunk',
|
||||
inputs: {
|
||||
run_id: '${{ github.run_id }}'
|
||||
}
|
||||
});
|
||||
|
47
.github/workflows/javascript-tests.yml
vendored
47
.github/workflows/javascript-tests.yml
vendored
@ -8,8 +8,9 @@ on:
|
||||
- '3.[89]'
|
||||
- '[4-9].[0-9]'
|
||||
tags:
|
||||
- '3.[89]*'
|
||||
- '[4-9].[0-9]*'
|
||||
- '[0-9]+.[0-9]'
|
||||
- '[0-9]+.[0-9].[0-9]+'
|
||||
- '!3.7.[0-9]+'
|
||||
pull_request:
|
||||
branches:
|
||||
- trunk
|
||||
@ -18,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,9 +44,9 @@ jobs:
|
||||
# Performs the following steps:
|
||||
# - Checks out the repository.
|
||||
# - Logs debug information about the GitHub Action runner.
|
||||
# - Installs NodeJS.
|
||||
# - Installs Node.js.
|
||||
# - Logs updated debug information.
|
||||
# _ Installs NPM dependencies.
|
||||
# _ Installs npm dependencies.
|
||||
# - Run the WordPress QUnit tests.
|
||||
test-js:
|
||||
name: QUnit Tests
|
||||
@ -55,7 +56,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Log debug information
|
||||
run: |
|
||||
@ -64,8 +65,8 @@ jobs:
|
||||
git --version
|
||||
svn --version
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: npm
|
||||
@ -93,3 +94,33 @@ jobs:
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
|
||||
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
|
||||
|
||||
failed-workflow:
|
||||
name: Failed workflow tasks
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test-js, slack-notifications ]
|
||||
if: |
|
||||
always() &&
|
||||
github.repository == 'WordPress/wordpress-develop' &&
|
||||
github.event_name != 'pull_request' &&
|
||||
github.run_attempt < 2 &&
|
||||
(
|
||||
needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
|
||||
)
|
||||
|
||||
steps:
|
||||
- name: Dispatch workflow run
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
retries: 2
|
||||
retry-exempt-status-codes: 418
|
||||
script: |
|
||||
github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'failed-workflow.yml',
|
||||
ref: 'trunk',
|
||||
inputs: {
|
||||
run_id: '${{ github.run_id }}'
|
||||
}
|
||||
});
|
||||
|
44
.github/workflows/php-compatibility.yml
vendored
44
.github/workflows/php-compatibility.yml
vendored
@ -8,8 +8,10 @@ on:
|
||||
- '5.[5-9]'
|
||||
- '[6-9].[0-9]'
|
||||
tags:
|
||||
- '5.[5-9]*'
|
||||
- '[6-9].[0-9]*'
|
||||
- '[0-9]+.[0-9]'
|
||||
- '[0-9]+.[0-9].[0-9]+'
|
||||
- '![34].[0-9].[0-9]+'
|
||||
- '!5.[0-4].[0-9]+'
|
||||
pull_request:
|
||||
branches:
|
||||
- trunk
|
||||
@ -55,10 +57,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
|
||||
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
|
||||
with:
|
||||
php-version: '7.4'
|
||||
coverage: none
|
||||
@ -70,9 +72,9 @@ jobs:
|
||||
composer --version
|
||||
|
||||
- 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 --no-interaction"
|
||||
composer-options: "--no-progress --no-ansi"
|
||||
|
||||
- name: Make Composer packages available globally
|
||||
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
||||
@ -95,3 +97,33 @@ jobs:
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
|
||||
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
|
||||
|
||||
failed-workflow:
|
||||
name: Failed workflow tasks
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ php-compatibility, slack-notifications ]
|
||||
if: |
|
||||
always() &&
|
||||
github.repository == 'WordPress/wordpress-develop' &&
|
||||
github.event_name != 'pull_request' &&
|
||||
github.run_attempt < 2 &&
|
||||
(
|
||||
needs.php-compatibility.result == 'cancelled' || needs.php-compatibility.result == 'failure'
|
||||
)
|
||||
|
||||
steps:
|
||||
- name: Dispatch workflow run
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
retries: 2
|
||||
retry-exempt-status-codes: 418
|
||||
script: |
|
||||
github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'failed-workflow.yml',
|
||||
ref: 'trunk',
|
||||
inputs: {
|
||||
run_id: '${{ github.run_id }}'
|
||||
}
|
||||
});
|
||||
|
58
.github/workflows/phpunit-tests.yml
vendored
58
.github/workflows/phpunit-tests.yml
vendored
@ -7,8 +7,8 @@ on:
|
||||
- '3.[7-9]'
|
||||
- '[4-9].[0-9]'
|
||||
tags:
|
||||
- '3.[7-9]*'
|
||||
- '[4-9].[0-9]*'
|
||||
- '[0-9]+.[0-9]'
|
||||
- '[0-9]+.[0-9].[0-9]+'
|
||||
pull_request:
|
||||
branches:
|
||||
- trunk
|
||||
@ -28,7 +28,7 @@ concurrency:
|
||||
|
||||
env:
|
||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
|
||||
# Controls which NPM script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
|
||||
# Controls which npm script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
|
||||
PHPUNIT_SCRIPT: php
|
||||
LOCAL_PHP_MEMCACHED: ${{ false }}
|
||||
SLOW_TESTS: 'external-http,media,restapi'
|
||||
@ -39,8 +39,8 @@ 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
|
||||
# - Installs Node.js.
|
||||
# - Installs npm dependencies
|
||||
# - Configures caching for Composer.
|
||||
# - Installs Composer dependencies.
|
||||
# - Logs Docker debug information (about the Docker installation within the runner).
|
||||
@ -107,27 +107,27 @@ jobs:
|
||||
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: npm
|
||||
|
||||
- name: Install Dependencies
|
||||
- name: Install npm dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Get composer cache directory
|
||||
- name: Get Composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
|
||||
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
|
||||
env:
|
||||
cache-name: cache-composer-dependencies
|
||||
with:
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
path: ${{ steps.composer-cache.outputs.composer_dir }}
|
||||
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
|
||||
- name: Install Composer dependencies
|
||||
@ -223,7 +223,7 @@ jobs:
|
||||
|
||||
- name: Checkout the WordPress Test Reporter
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
with:
|
||||
repository: 'WordPress/phpunit-test-runner'
|
||||
path: 'test-runner'
|
||||
@ -246,3 +246,33 @@ jobs:
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
|
||||
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
|
||||
|
||||
failed-workflow:
|
||||
name: Failed workflow tasks
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test-php, slack-notifications ]
|
||||
if: |
|
||||
always() &&
|
||||
github.repository == 'WordPress/wordpress-develop' &&
|
||||
github.event_name != 'pull_request' &&
|
||||
github.run_attempt < 2 &&
|
||||
(
|
||||
needs.test-php.result == 'cancelled' || needs.test-php.result == 'failure'
|
||||
)
|
||||
|
||||
steps:
|
||||
- name: Dispatch workflow run
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
retries: 2
|
||||
retry-exempt-status-codes: 418
|
||||
script: |
|
||||
github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'failed-workflow.yml',
|
||||
ref: 'trunk',
|
||||
inputs: {
|
||||
run_id: '${{ github.run_id }}'
|
||||
}
|
||||
});
|
||||
|
76
.github/workflows/test-npm.yml
vendored
76
.github/workflows/test-npm.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: Test NPM
|
||||
name: Test npm
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -6,17 +6,20 @@ on:
|
||||
- trunk
|
||||
- '3.[7-9]'
|
||||
- '[4-9].[0-9]'
|
||||
tags:
|
||||
- '[0-9]+.[0-9]'
|
||||
- '[0-9]+.[0-9].[0-9]+'
|
||||
pull_request:
|
||||
branches:
|
||||
- trunk
|
||||
- '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.
|
||||
@ -34,19 +37,19 @@ 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.
|
||||
# - Logs debug information about the GitHub Action runner.
|
||||
# - Installs NodeJS.
|
||||
# _ Installs NPM dependencies.
|
||||
# - Installs Node.js.
|
||||
# _ Installs npm dependencies.
|
||||
# - Builds WordPress to run from the `build` directory.
|
||||
# - Cleans up after building WordPress to the `build` directory.
|
||||
# - Builds WordPress to run from the `src` directory.
|
||||
# - Cleans up after building WordPress to the `src` directory.
|
||||
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' }}
|
||||
@ -57,7 +60,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Log debug information
|
||||
run: |
|
||||
@ -67,8 +70,8 @@ jobs:
|
||||
git --version
|
||||
svn --version
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: npm
|
||||
@ -88,28 +91,32 @@ jobs:
|
||||
- name: Clean after building in /src
|
||||
run: npm run grunt clean -- --dev
|
||||
|
||||
# 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.
|
||||
# - Logs debug information about the GitHub Action runner.
|
||||
# - Installs NodeJS.
|
||||
# _ Installs NPM dependencies.
|
||||
# - Installs Node.js.
|
||||
# _ Installs npm dependencies.
|
||||
# - Builds WordPress to run from the `build` directory.
|
||||
# - Cleans up after building WordPress to the `build` directory.
|
||||
# - Builds WordPress to run from the `src` directory.
|
||||
# - Cleans up after building WordPress to the `src` directory.
|
||||
test-npm-macos:
|
||||
name: Test NPM on MacOS
|
||||
name: Test npm on MacOS
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 20
|
||||
timeout-minutes: 30
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
|
||||
- name: Log debug information
|
||||
run: |
|
||||
@ -119,8 +126,8 @@ jobs:
|
||||
git --version
|
||||
svn --version
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: npm
|
||||
@ -152,3 +159,34 @@ jobs:
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
|
||||
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
|
||||
|
||||
failed-workflow:
|
||||
name: Failed workflow tasks
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test-npm, test-npm-macos, slack-notifications ]
|
||||
if: |
|
||||
always() &&
|
||||
github.repository == 'WordPress/wordpress-develop' &&
|
||||
github.event_name != 'pull_request' &&
|
||||
github.run_attempt < 2 &&
|
||||
(
|
||||
needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
|
||||
needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
|
||||
)
|
||||
|
||||
steps:
|
||||
- name: Dispatch workflow run
|
||||
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
|
||||
with:
|
||||
retries: 2
|
||||
retry-exempt-status-codes: 418
|
||||
script: |
|
||||
github.rest.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: 'failed-workflow.yml',
|
||||
ref: 'trunk',
|
||||
inputs: {
|
||||
run_id: '${{ github.run_id }}'
|
||||
}
|
||||
});
|
||||
|
58
.github/workflows/test-old-branches.yml
vendored
58
.github/workflows/test-old-branches.yml
vendored
@ -1,58 +0,0 @@
|
||||
name: Test old branches
|
||||
|
||||
on:
|
||||
# Once weekly On Mondays at 00:00 UTC.
|
||||
schedule:
|
||||
- cron: '0 0 * * 1'
|
||||
|
||||
jobs:
|
||||
dispatch-workflows-for-old-branches:
|
||||
name: ${{ matrix.workflow }} for ${{ matrix.branch }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
workflow: [
|
||||
'coding-standards.yml',
|
||||
'javascript-tests.yml',
|
||||
'phpunit-tests.yml',
|
||||
'test-npm.yml'
|
||||
]
|
||||
branch: [
|
||||
'5.7', '5.6', '5.5', '5.4', '5.3', '5.2', '5.1', '5.0',
|
||||
'4.9', '4.8', '4.7', '4.6', '4.5', '4.4', '4.3', '4.2', '4.1', '4.0',
|
||||
'3.9', '3.8', '3.7'
|
||||
]
|
||||
include:
|
||||
# PHP Compatibility testing was introduced in 5.5.
|
||||
- branch: '5.7'
|
||||
workflow: 'php-compatibility.yml'
|
||||
- branch: '5.6'
|
||||
workflow: 'php-compatibility.yml'
|
||||
- branch: '5.5'
|
||||
workflow: 'php-compatibility.yml'
|
||||
|
||||
# End to End testing was introduced in 5.3 but later removed as there were no meaningful assertions.
|
||||
# Only the officially supported major branch runs E2E tests so that more assertions can be added, and the
|
||||
# workflow does not continue to run needlessly on old branches.
|
||||
- branch: '5.7'
|
||||
workflow: 'end-to-end-tests.yml'
|
||||
exclude:
|
||||
# Coding standards and JavaScript testing did not take place in 3.7.
|
||||
- branch: '3.7'
|
||||
workflow: 'coding-standards.yml'
|
||||
- branch: '3.7'
|
||||
workflow: 'javascript-tests.yml'
|
||||
|
||||
steps:
|
||||
- name: Dispatch workflow run
|
||||
uses: actions/github-script@47f7cf65b5ced0830a325f705cad64f2f58dddf7 # v3.1.0
|
||||
with:
|
||||
github-token: ${{ secrets.GHA_OLD_BRANCH_DISPATCH }}
|
||||
script: |
|
||||
github.actions.createWorkflowDispatch({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
workflow_id: '${{ matrix.workflow }}',
|
||||
ref: '${{ matrix.branch }}'
|
||||
});
|
@ -12,9 +12,8 @@ jobs:
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
|
||||
|
||||
steps:
|
||||
- uses: bubkoo/welcome-action@8dbbac2540d155744c90e4e37da6b05ffc9c5e2c # v1.0.3
|
||||
- uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
FIRST_PR_COMMENT: >
|
||||
Hi @{{ author }}! 👋
|
||||
|
||||
|
@ -53,7 +53,7 @@ services:
|
||||
# The MySQL container.
|
||||
##
|
||||
mysql:
|
||||
image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest}
|
||||
image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest}
|
||||
|
||||
networks:
|
||||
- wpdevnet
|
||||
|
Loading…
x
Reference in New Issue
Block a user