Skip to content

Commit 6b4d0ba

Browse files
authored
Merge branch 'master' into patch-4
2 parents d1f3775 + d088e31 commit 6b4d0ba

1,632 files changed

Lines changed: 71743 additions & 33833 deletions

File tree

Some content is hidden

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

.env

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#
77
# Below, the following substitutions can be made:
88
# - '{version}': any major.minor PHP version from 5.2 onwards.
9-
# - '{phpunit_version}': any major PHPUnit version starting with 4.
109
##
1110

1211
# The site will be available at http://localhost:LOCAL_PORT
@@ -18,27 +17,6 @@ LOCAL_DIR=src
1817
# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
1918
LOCAL_PHP=latest
2019

21-
##
22-
# The PHPUnit version to use when running tests.
23-
#
24-
# Support for new PHPUnit versions is not backported to past versions, so some old WordPress branches require an older
25-
# version to run tests.
26-
#
27-
# Valid versions are:
28-
# - 'latest' for the highest version of PHPUnit supported on the highest version of PHP supported.
29-
# - '{version}-fpm' for the highest version of PHPUnit supported on the specified version of PHP.
30-
# - '{phpunit_version}-php-{version}-fpm' for a specific version of PHPUnit on the specified version of PHP. This format
31-
# is only available for PHP versions 5.6 and higher.
32-
#
33-
# For the full list of available options, see https://hub.docker.com/r/wordpressdevelop/phpunit/tags.
34-
#
35-
# For full documentation on PHPUnit compatibility and WordPress versions, see
36-
# https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/.
37-
#
38-
# This defaults to the value assigned to the value of LOCAL_PHP.
39-
##
40-
LOCAL_PHPUNIT=${LOCAL_PHP}
41-
4220
# Whether or not to enable XDebug.
4321
LOCAL_PHP_XDEBUG=false
4422

@@ -71,10 +49,3 @@ LOCAL_WP_ENVIRONMENT_TYPE=local
7149

7250
# The URL to use when running e2e tests.
7351
WP_BASE_URL=http://localhost:${LOCAL_PORT}
74-
75-
##
76-
# The revision number of the WordPress Importer plugin to use when running unit tests.
77-
#
78-
# This should be an SVN revision number from the official plugin repository on wordpress.org.
79-
##
80-
WP_IMPORTER_REVISION=2387243

.github/workflows/coding-standards.yml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ on:
3232
- 'phpcs.xml.dist'
3333
# Changes to workflow files should always verify all workflows are successful.
3434
- '.github/workflows/*.yml'
35+
workflow_dispatch:
36+
37+
# Cancels all previous workflow runs for pull requests that have not completed.
38+
concurrency:
39+
# The concurrency group contains the workflow name and the branch name for pull requests
40+
# or the commit hash for any other events.
41+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
42+
cancel-in-progress: true
3543

3644
jobs:
3745
# Runs PHP coding standards checks.
@@ -47,7 +55,7 @@ jobs:
4755
# - Logs PHP_CodeSniffer debug information.
4856
# - Runs PHPCS on the full codebase with warnings suppressed.
4957
# - Runs PHPCS on the `tests` directory without warnings suppressed.
50-
# - todo: Configure Slack notifications for failing scans.
58+
# - Ensures version-controlled files are not modified or deleted.
5159
phpcs:
5260
name: PHP coding standards
5361
runs-on: ubuntu-latest
@@ -86,6 +94,9 @@ jobs:
8694
- name: Check test suite files for warnings
8795
run: phpcs tests -q --report=checkstyle | cs2pr
8896

97+
- name: Ensure version-controlled files are not modified during the tests
98+
run: git diff --exit-code
99+
89100
# Runs the JavaScript coding standards checks.
90101
#
91102
# JSHint violations are not currently reported inline with annotations.
@@ -94,11 +105,10 @@ jobs:
94105
# - Checks out the repository.
95106
# - Logs debug information about the runner container.
96107
# - Installs NodeJS 14.
97-
# - Sets up caching for NPM.
98108
# - Logs updated debug information.
99109
# _ Installs NPM dependencies using install-changed to hash the `package.json` file.
100110
# - Run the WordPress JSHint checks.
101-
# - todo: Configure Slack notifications for failing tests.
111+
# - Ensures version-controlled files are not modified or deleted.
102112
jshint:
103113
name: JavaScript coding standards
104114
runs-on: ubuntu-latest
@@ -118,18 +128,10 @@ jobs:
118128
svn --version
119129
120130
- name: Install NodeJS
121-
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
131+
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
122132
with:
123133
node-version: 14
124-
125-
- name: Cache NodeJS modules
126-
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
127-
env:
128-
cache-name: cache-node-modules
129-
with:
130-
# npm cache files are stored in `~/.npm` on Linux/macOS
131-
path: ~/.npm
132-
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
134+
cache: npm
133135

134136
- name: Log debug information
135137
run: |
@@ -141,3 +143,19 @@ jobs:
141143

142144
- name: Run JSHint
143145
run: npm run grunt jshint
146+
147+
- name: Ensure version-controlled files are not modified or deleted
148+
run: git diff --exit-code
149+
150+
slack-notifications:
151+
name: Slack Notifications
152+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
153+
needs: [ phpcs, jshint ]
154+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
155+
with:
156+
calling_status: ${{ needs.phpcs.result == 'success' && needs.jshint.result == 'success' && 'success' || ( needs.phpcs.result == 'cancelled' || needs.jshint.result == 'cancelled' ) && 'cancelled' || 'failure' }}
157+
secrets:
158+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
159+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
160+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
161+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

.github/workflows/end-to-end-tests.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ on:
1717
- trunk
1818
- '5.[3-9]'
1919
- '[6-9].[0-9]'
20+
workflow_dispatch:
21+
22+
# Cancels all previous workflow runs for pull requests that have not completed.
23+
concurrency:
24+
# The concurrency group contains the workflow name and the branch name for pull requests
25+
# or the commit hash for any other events.
26+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
27+
cancel-in-progress: true
2028

2129
env:
2230
LOCAL_DIR: build
@@ -25,12 +33,10 @@ jobs:
2533
# Runs the end-to-end test suite.
2634
#
2735
# Performs the following steps:
28-
# - Cancels all previous workflow runs for pull requests that have not completed.
2936
# - Set environment variables.
3037
# - Checks out the repository.
3138
# - Logs debug information about the runner container.
3239
# - Installs NodeJS 14.
33-
# - Sets up caching for NPM.
3440
# _ Installs NPM dependencies using install-changed to hash the `package.json` file.
3541
# - Builds WordPress to run from the `build` directory.
3642
# - Starts the WordPress Docker container.
@@ -39,17 +45,13 @@ jobs:
3945
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
4046
# - Install WordPress within the Docker container.
4147
# - Run the E2E tests.
42-
# - todo: Configure Slack notifications for failing tests.
48+
# - Ensures version-controlled files are not modified or deleted.
4349
e2e-tests:
4450
name: E2E Tests
4551
runs-on: ubuntu-latest
4652
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
4753

4854
steps:
49-
- name: Cancel previous runs of this workflow (pull requests only)
50-
if: ${{ github.event_name == 'pull_request' }}
51-
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
52-
5355
- name: Configure environment variables
5456
run: |
5557
echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
@@ -70,18 +72,10 @@ jobs:
7072
locale -a
7173
7274
- name: Install NodeJS
73-
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
75+
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
7476
with:
7577
node-version: 14
76-
77-
- name: Cache NodeJS modules
78-
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
79-
env:
80-
cache-name: cache-node-modules
81-
with:
82-
# npm cache files are stored in `~/.npm` on Linux/macOS
83-
path: ~/.npm
84-
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
78+
cache: npm
8579

8680
- name: Install Dependencies
8781
run: npm ci
@@ -119,3 +113,19 @@ jobs:
119113

120114
- name: Run E2E tests
121115
run: npm run test:e2e
116+
117+
- name: Ensure version-controlled files are not modified or deleted
118+
run: git diff --exit-code
119+
120+
slack-notifications:
121+
name: Slack Notifications
122+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
123+
needs: [ e2e-tests ]
124+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
125+
with:
126+
calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }}
127+
secrets:
128+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
129+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
130+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
131+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

.github/workflows/javascript-tests.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,32 @@ on:
3030
- 'tests/qunit/**'
3131
# Changes to workflow files should always verify all workflows are successful.
3232
- '.github/workflows/*.yml'
33+
workflow_dispatch:
34+
35+
# Cancels all previous workflow runs for pull requests that have not completed.
36+
concurrency:
37+
# The concurrency group contains the workflow name and the branch name for pull requests
38+
# or the commit hash for any other events.
39+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
40+
cancel-in-progress: true
3341

3442
jobs:
3543
# Runs the QUnit tests for WordPress.
3644
#
3745
# Performs the following steps:
38-
# - Cancels all previous workflow runs for pull requests that have not completed.
3946
# - Checks out the repository.
4047
# - Logs debug information about the runner container.
4148
# - Installs NodeJS 14.
42-
# - Sets up caching for NPM.
4349
# - Logs updated debug information.
4450
# _ Installs NPM dependencies using install-changed to hash the `package.json` file.
4551
# - Run the WordPress QUnit tests.
46-
# - todo: Configure Slack notifications for failing tests.
52+
# - Ensures version-controlled files are not modified or deleted.
4753
test-js:
4854
name: QUnit Tests
4955
runs-on: ubuntu-latest
5056
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
5157

5258
steps:
53-
- name: Cancel previous runs of this workflow (pull requests only)
54-
if: ${{ github.event_name == 'pull_request' }}
55-
uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
56-
5759
- name: Checkout repository
5860
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
5961

@@ -65,18 +67,10 @@ jobs:
6567
svn --version
6668
6769
- name: Install NodeJS
68-
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
70+
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
6971
with:
7072
node-version: 14
71-
72-
- name: Cache NodeJS modules
73-
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
74-
env:
75-
cache-name: cache-node-modules
76-
with:
77-
# npm cache files are stored in `~/.npm` on Linux/macOS
78-
path: ~/.npm
79-
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
73+
cache: npm
8074

8175
- name: Log debug information
8276
run: |
@@ -88,3 +82,19 @@ jobs:
8882

8983
- name: Run QUnit tests
9084
run: npm run grunt qunit:compiled
85+
86+
- name: Ensure version-controlled files are not modified or deleted
87+
run: git diff --exit-code
88+
89+
slack-notifications:
90+
name: Slack Notifications
91+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
92+
needs: [ test-js ]
93+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
94+
with:
95+
calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
96+
secrets:
97+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
98+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
99+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
100+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

.github/workflows/php-compatibility.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ on:
2626
- 'phpcompat.xml.dist'
2727
# Changes to workflow files should always verify all workflows are successful.
2828
- '.github/workflows/*.yml'
29+
workflow_dispatch:
30+
31+
# Cancels all previous workflow runs for pull requests that have not completed.
32+
concurrency:
33+
# The concurrency group contains the workflow name and the branch name for pull requests
34+
# or the commit hash for any other events.
35+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
36+
cancel-in-progress: true
2937

3038
jobs:
3139

@@ -41,8 +49,8 @@ jobs:
4149
# - Make Composer packages available globally.
4250
# - Logs PHP_CodeSniffer debug information.
4351
# - Runs the PHP compatibility tests.
44-
# - todo: Configure Slack notifications for failing scans.
45-
php-comatibility:
52+
# - Ensures version-controlled files are not modified or deleted.
53+
php-compatibility:
4654
name: Check PHP compatibility
4755
runs-on: ubuntu-latest
4856
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
@@ -76,3 +84,19 @@ jobs:
7684

7785
- name: Run PHP compatibility tests
7886
run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
87+
88+
- name: Ensure version-controlled files are not modified or deleted
89+
run: git diff --exit-code
90+
91+
slack-notifications:
92+
name: Slack Notifications
93+
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@master
94+
needs: [ php-compatibility ]
95+
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
96+
with:
97+
calling_status: ${{ needs.php-compatibility.result == 'success' && 'success' || needs.php-compatibility.result == 'cancelled' && 'cancelled' || 'failure' }}
98+
secrets:
99+
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
100+
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
101+
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
102+
SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}

0 commit comments

Comments
 (0)