Skip to content

Commit

Permalink
Merge pull request #665 from Automattic/develop
Browse files Browse the repository at this point in the history
Release 2.3.0
  • Loading branch information
rebeccahum committed Apr 19, 2021
2 parents 4d06124 + 181b6f7 commit a2eef7f
Show file tree
Hide file tree
Showing 70 changed files with 1,770 additions and 764 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.phpcs.xml.dist export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.github export-ignore
/bin export-ignore
Expand Down
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/release-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ assignees: GaryJones, rebeccahum

---

⚠️ DO NOT MERGE (YET) ⚠️
:warning: DO NOT MERGE (YET) :warning:

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

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

- [ ] Add change log for this release: PR #XXX
- [ ] Double-check whether any dependencies need bumping.
- [ ] Merge this PR.
- [ ] Add signed release tag against `master`.
- [ ] Close the current milestone.
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: BasicQA

on:
# Run on all pushes and on all pull requests.
# Prevent the "push" build from running when there are only irrelevant changes.
push:
paths-ignore:
- '**.md'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
checkcs:
name: 'Basic CS and QA checks'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: cs2pr

- name: Install xmllint
run: sudo apt-get install --no-install-recommends -y libxml2-utils

# Show XML violations inline in the file diff.
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
- uses: korelstar/xmllint-problem-matcher@v1

# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- name: Validate Composer installation
run: composer validate --no-check-all --strict

- name: 'Composer: adjust dependencies'
# Using PHPCS `master` as an early detection system for bugs upstream.
run: composer require --no-update --no-scripts squizlabs/php_codesniffer:"dev-master"

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: 'Validate XML against schema and check code style'
run: ./bin/xml-lint

# Check the code-style consistency of the PHP files.
- name: Check PHP code style
continue-on-error: true
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml

- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml

# Check that the sniffs available are feature complete.
# For now, just check that all sniffs have unit tests.
# At a later stage the documentation check can be activated.
- name: Check sniff feature completeness
run: composer check-complete
90 changes: 90 additions & 0 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Quicktest

on:
# Run on pushes, including merges, to all branches except `master`.
push:
branches-ignore:
- master
paths-ignore:
- '**.md'
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
#### QUICK TEST STAGE ####
# This is a much quicker test which only runs the unit tests and linting against the low/high
# supported PHP/PHPCS combinations.
quicktest:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- php: '5.4'
phpcs_version: 'dev-master'
wpcs_version: '2.3.*'
- php: '5.4'
phpcs_version: '3.5.5'
wpcs_version: '2.3.*'

- php: 'latest'
phpcs_version: 'dev-master'
wpcs_version: '2.3.*'
- php: 'latest'
# PHPCS 3.5.7 is the lowest version of PHPCS which supports PHP 8.0.
phpcs_version: '3.5.7'
wpcs_version: '2.3.*'

name: "QTest${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"


steps:
- name: Checkout code
uses: actions/checkout@v2

# On stable PHPCS versions, allow for PHP deprecation notices.
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
- name: Setup ini config
id: set_ini
run: |
if [[ "${{ matrix.phpcs_version }}" != "dev-master" ]]; then
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED'
else
echo '::set-output name=PHP_INI::error_reporting=E_ALL'
fi
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
coverage: none

- name: 'Composer: set PHPCS and WPCS versions for tests'
run: |
composer require --no-update --no-scripts squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}"
composer require --no-update --no-scripts wp-coding-standards/wpcs:"${{ matrix.wpcs_version }}"
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies - normal
if: ${{ startsWith( matrix.php, '8' ) == false && matrix.php != 'latest' }}
uses: "ramsey/composer-install@v1"

# PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform
# requirements to get PHPUnit 7.x to install on nightly.
- name: Install Composer dependencies - with ignore platform
if: ${{ startsWith( matrix.php, '8' ) || matrix.php == 'latest' }}
uses: "ramsey/composer-install@v1"
with:
composer-options: --ignore-platform-reqs

- name: Lint against parse errors
if: matrix.phpcs_version == 'dev-master'
run: ./bin/php-lint

- name: Run the unit tests
run: ./bin/unit-tests

- name: Run the ruleset tests
run: ./bin/ruleset-tests
141 changes: 141 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Test

on:
# Run on pushes to `master` and on all pull requests.
# Prevent the "push" build from running when there are only irrelevant changes.
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
#### PHP LINT STAGE ####
# Linting against high/low PHP versions should catch everything.
# If needs be, we can always add interim versions at a later point in time.
lint:
runs-on: ubuntu-latest

strategy:
matrix:
php: ['5.4', 'latest']
experimental: [false]

include:
- php: '8.1'
experimental: true

name: "Lint: PHP ${{ matrix.php }}"
continue-on-error: ${{ matrix.experimental }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: cs2pr

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: Lint against parse errors
run: ./bin/php-lint --checkstyle | cs2pr

test:
# No use running the tests if there is a linting error somewhere as they would fail anyway.
needs: lint

runs-on: ubuntu-latest

strategy:
# Keys:
# - php: The PHP versions to test against.
# - phpcs_version: The PHPCS versions to test against.
# IMPORTANT: test runs shouldn't fail because of PHPCS being incompatible with a PHP version.
# - PHPCS will run without errors on PHP 5.4 - 7.4 on any supported version.
# - PHP 8.0 needs PHPCS 3.5.7+ to run without errors.
# - The `wpcs_version` key is added to allow additional test builds when multiple WPCS versions
# would be supported. As, at this time, only the latest stable release of WPCS is supported,
# no additional versions are included in the array.
# - experimental: Whether the build is "allowed to fail".
matrix:
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
phpcs_version: ['3.5.5', 'dev-master']
wpcs_version: ['2.3.*']
experimental: [false]

include:
# Complete the matrix by adding PHP 8.0, but only test against compatible PHPCS versions.
- php: '8.0'
phpcs_version: 'dev-master'
wpcs_version: '2.3.*'
experimental: false
- php: '8.0'
# PHPCS 3.5.7 is the lowest version of PHPCS which supports PHP 8.0.
phpcs_version: '3.5.7'
wpcs_version: '2.3.*'
experimental: false

# Experimental builds. These are allowed to fail.
#- php: '8.1'
# phpcs_version: 'dev-master'
# wpcs_version: '2.3.*'
# experimental: true

name: "Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }} - WPCS ${{ matrix.wpcs_version }}"

continue-on-error: ${{ matrix.experimental }}

steps:
- name: Checkout code
uses: actions/checkout@v2

# On stable PHPCS versions, allow for PHP deprecation notices.
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
- name: Setup ini config
id: set_ini
run: |
if [[ "${{ matrix.phpcs_version }}" != "dev-master" ]]; then
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED'
else
echo '::set-output name=PHP_INI::error_reporting=E_ALL'
fi
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
coverage: none

- name: 'Composer: set PHPCS and WPCS versions for tests'
run: |
composer require --no-update --no-scripts squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}"
composer require --no-update --no-scripts wp-coding-standards/wpcs:"${{ matrix.wpcs_version }}"
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies - normal
if: ${{ startsWith( matrix.php, '8' ) == false }}
uses: "ramsey/composer-install@v1"

# PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform
# requirements to get PHPUnit 7.x to install on nightly.
- name: Install Composer dependencies - with ignore platform
if: ${{ startsWith( matrix.php, '8' ) }}
uses: "ramsey/composer-install@v1"
with:
composer-options: --ignore-platform-reqs

- name: Run the unit tests
run: ./bin/unit-tests

- name: Run the ruleset tests
run: ./bin/ruleset-tests
Loading

0 comments on commit a2eef7f

Please sign in to comment.