Skip to content

Commit a2eef7f

Browse files
authored
Merge pull request #665 from Automattic/develop
Release 2.3.0
2 parents 4d06124 + 181b6f7 commit a2eef7f

File tree

70 files changed

+1770
-764
lines changed

Some content is hidden

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

70 files changed

+1770
-764
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
/.gitattributes export-ignore
99
/.gitignore export-ignore
1010
/.phpcs.xml.dist export-ignore
11-
/.travis.yml export-ignore
1211
/phpunit.xml.dist export-ignore
1312
/.github export-ignore
1413
/bin export-ignore

.github/ISSUE_TEMPLATE/release-template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ assignees: GaryJones, rebeccahum
77

88
---
99

10-
⚠️ DO NOT MERGE (YET) ⚠️
10+
:warning: DO NOT MERGE (YET) :warning:
1111

1212
[Remaining work for this Milestone](https://github.com/Automattic/VIP-Coding-Standards/milestone/X)
1313

1414
PR for tracking changes for the X.Y.Z release. Target release date: DOW DD MMMM YYYY.
1515

1616
- [ ] Add change log for this release: PR #XXX
17+
- [ ] Double-check whether any dependencies need bumping.
1718
- [ ] Merge this PR.
1819
- [ ] Add signed release tag against `master`.
1920
- [ ] Close the current milestone.

.github/workflows/basics.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: BasicQA
2+
3+
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the "push" build from running when there are only irrelevant changes.
6+
push:
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch:
12+
13+
jobs:
14+
checkcs:
15+
name: 'Basic CS and QA checks'
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Install PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: '7.4'
26+
coverage: none
27+
tools: cs2pr
28+
29+
- name: Install xmllint
30+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
31+
32+
# Show XML violations inline in the file diff.
33+
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
34+
- uses: korelstar/xmllint-problem-matcher@v1
35+
36+
# Validate the composer.json file.
37+
# @link https://getcomposer.org/doc/03-cli.md#validate
38+
- name: Validate Composer installation
39+
run: composer validate --no-check-all --strict
40+
41+
- name: 'Composer: adjust dependencies'
42+
# Using PHPCS `master` as an early detection system for bugs upstream.
43+
run: composer require --no-update --no-scripts squizlabs/php_codesniffer:"dev-master"
44+
45+
# Install dependencies and handle caching in one go.
46+
# @link https://github.com/marketplace/actions/install-composer-dependencies
47+
- name: Install Composer dependencies
48+
uses: "ramsey/composer-install@v1"
49+
50+
- name: 'Validate XML against schema and check code style'
51+
run: ./bin/xml-lint
52+
53+
# Check the code-style consistency of the PHP files.
54+
- name: Check PHP code style
55+
continue-on-error: true
56+
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml
57+
58+
- name: Show PHPCS results in PR
59+
run: cs2pr ./phpcs-report.xml
60+
61+
# Check that the sniffs available are feature complete.
62+
# For now, just check that all sniffs have unit tests.
63+
# At a later stage the documentation check can be activated.
64+
- name: Check sniff feature completeness
65+
run: composer check-complete

.github/workflows/quicktest.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Quicktest
2+
3+
on:
4+
# Run on pushes, including merges, to all branches except `master`.
5+
push:
6+
branches-ignore:
7+
- master
8+
paths-ignore:
9+
- '**.md'
10+
# Allow manually triggering the workflow.
11+
workflow_dispatch:
12+
13+
jobs:
14+
#### QUICK TEST STAGE ####
15+
# This is a much quicker test which only runs the unit tests and linting against the low/high
16+
# supported PHP/PHPCS combinations.
17+
quicktest:
18+
runs-on: ubuntu-latest
19+
20+
strategy:
21+
matrix:
22+
include:
23+
- php: '5.4'
24+
phpcs_version: 'dev-master'
25+
wpcs_version: '2.3.*'
26+
- php: '5.4'
27+
phpcs_version: '3.5.5'
28+
wpcs_version: '2.3.*'
29+
30+
- php: 'latest'
31+
phpcs_version: 'dev-master'
32+
wpcs_version: '2.3.*'
33+
- php: 'latest'
34+
# PHPCS 3.5.7 is the lowest version of PHPCS which supports PHP 8.0.
35+
phpcs_version: '3.5.7'
36+
wpcs_version: '2.3.*'
37+
38+
name: "QTest${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
39+
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v2
44+
45+
# On stable PHPCS versions, allow for PHP deprecation notices.
46+
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
47+
- name: Setup ini config
48+
id: set_ini
49+
run: |
50+
if [[ "${{ matrix.phpcs_version }}" != "dev-master" ]]; then
51+
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED'
52+
else
53+
echo '::set-output name=PHP_INI::error_reporting=E_ALL'
54+
fi
55+
56+
- name: Install PHP
57+
uses: shivammathur/setup-php@v2
58+
with:
59+
php-version: ${{ matrix.php }}
60+
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
61+
coverage: none
62+
63+
- name: 'Composer: set PHPCS and WPCS versions for tests'
64+
run: |
65+
composer require --no-update --no-scripts squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}"
66+
composer require --no-update --no-scripts wp-coding-standards/wpcs:"${{ matrix.wpcs_version }}"
67+
68+
# Install dependencies and handle caching in one go.
69+
# @link https://github.com/marketplace/actions/install-composer-dependencies
70+
- name: Install Composer dependencies - normal
71+
if: ${{ startsWith( matrix.php, '8' ) == false && matrix.php != 'latest' }}
72+
uses: "ramsey/composer-install@v1"
73+
74+
# PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform
75+
# requirements to get PHPUnit 7.x to install on nightly.
76+
- name: Install Composer dependencies - with ignore platform
77+
if: ${{ startsWith( matrix.php, '8' ) || matrix.php == 'latest' }}
78+
uses: "ramsey/composer-install@v1"
79+
with:
80+
composer-options: --ignore-platform-reqs
81+
82+
- name: Lint against parse errors
83+
if: matrix.phpcs_version == 'dev-master'
84+
run: ./bin/php-lint
85+
86+
- name: Run the unit tests
87+
run: ./bin/unit-tests
88+
89+
- name: Run the ruleset tests
90+
run: ./bin/ruleset-tests

.github/workflows/test.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Test
2+
3+
on:
4+
# Run on pushes to `master` and on all pull requests.
5+
# Prevent the "push" build from running when there are only irrelevant changes.
6+
push:
7+
branches:
8+
- master
9+
paths-ignore:
10+
- '**.md'
11+
pull_request:
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
jobs:
16+
#### PHP LINT STAGE ####
17+
# Linting against high/low PHP versions should catch everything.
18+
# If needs be, we can always add interim versions at a later point in time.
19+
lint:
20+
runs-on: ubuntu-latest
21+
22+
strategy:
23+
matrix:
24+
php: ['5.4', 'latest']
25+
experimental: [false]
26+
27+
include:
28+
- php: '8.1'
29+
experimental: true
30+
31+
name: "Lint: PHP ${{ matrix.php }}"
32+
continue-on-error: ${{ matrix.experimental }}
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
38+
- name: Install PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
coverage: none
43+
tools: cs2pr
44+
45+
- name: Install Composer dependencies
46+
uses: "ramsey/composer-install@v1"
47+
48+
- name: Lint against parse errors
49+
run: ./bin/php-lint --checkstyle | cs2pr
50+
51+
test:
52+
# No use running the tests if there is a linting error somewhere as they would fail anyway.
53+
needs: lint
54+
55+
runs-on: ubuntu-latest
56+
57+
strategy:
58+
# Keys:
59+
# - php: The PHP versions to test against.
60+
# - phpcs_version: The PHPCS versions to test against.
61+
# IMPORTANT: test runs shouldn't fail because of PHPCS being incompatible with a PHP version.
62+
# - PHPCS will run without errors on PHP 5.4 - 7.4 on any supported version.
63+
# - PHP 8.0 needs PHPCS 3.5.7+ to run without errors.
64+
# - The `wpcs_version` key is added to allow additional test builds when multiple WPCS versions
65+
# would be supported. As, at this time, only the latest stable release of WPCS is supported,
66+
# no additional versions are included in the array.
67+
# - experimental: Whether the build is "allowed to fail".
68+
matrix:
69+
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
70+
phpcs_version: ['3.5.5', 'dev-master']
71+
wpcs_version: ['2.3.*']
72+
experimental: [false]
73+
74+
include:
75+
# Complete the matrix by adding PHP 8.0, but only test against compatible PHPCS versions.
76+
- php: '8.0'
77+
phpcs_version: 'dev-master'
78+
wpcs_version: '2.3.*'
79+
experimental: false
80+
- php: '8.0'
81+
# PHPCS 3.5.7 is the lowest version of PHPCS which supports PHP 8.0.
82+
phpcs_version: '3.5.7'
83+
wpcs_version: '2.3.*'
84+
experimental: false
85+
86+
# Experimental builds. These are allowed to fail.
87+
#- php: '8.1'
88+
# phpcs_version: 'dev-master'
89+
# wpcs_version: '2.3.*'
90+
# experimental: true
91+
92+
name: "Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }} - WPCS ${{ matrix.wpcs_version }}"
93+
94+
continue-on-error: ${{ matrix.experimental }}
95+
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v2
99+
100+
# On stable PHPCS versions, allow for PHP deprecation notices.
101+
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
102+
- name: Setup ini config
103+
id: set_ini
104+
run: |
105+
if [[ "${{ matrix.phpcs_version }}" != "dev-master" ]]; then
106+
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED'
107+
else
108+
echo '::set-output name=PHP_INI::error_reporting=E_ALL'
109+
fi
110+
111+
- name: Install PHP
112+
uses: shivammathur/setup-php@v2
113+
with:
114+
php-version: ${{ matrix.php }}
115+
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
116+
coverage: none
117+
118+
- name: 'Composer: set PHPCS and WPCS versions for tests'
119+
run: |
120+
composer require --no-update --no-scripts squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}"
121+
composer require --no-update --no-scripts wp-coding-standards/wpcs:"${{ matrix.wpcs_version }}"
122+
123+
# Install dependencies and handle caching in one go.
124+
# @link https://github.com/marketplace/actions/install-composer-dependencies
125+
- name: Install Composer dependencies - normal
126+
if: ${{ startsWith( matrix.php, '8' ) == false }}
127+
uses: "ramsey/composer-install@v1"
128+
129+
# PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform
130+
# requirements to get PHPUnit 7.x to install on nightly.
131+
- name: Install Composer dependencies - with ignore platform
132+
if: ${{ startsWith( matrix.php, '8' ) }}
133+
uses: "ramsey/composer-install@v1"
134+
with:
135+
composer-options: --ignore-platform-reqs
136+
137+
- name: Run the unit tests
138+
run: ./bin/unit-tests
139+
140+
- name: Run the ruleset tests
141+
run: ./bin/ruleset-tests

0 commit comments

Comments
 (0)