2020-10-15 19:40:33 +00:00
|
|
|
name: PHP Compatibility
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
# The PHP compatibility testing was introduced in WordPress 5.5.
|
|
|
|
- '5.[5-9]'
|
2021-02-12 16:01:54 +00:00
|
|
|
- '[6-9].[0-9]'
|
|
|
|
tags:
|
|
|
|
- '5.[5-9]*'
|
|
|
|
- '[6-9].[0-9]*'
|
2020-10-15 19:40:33 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
# Runs PHP compatibility testing.
|
|
|
|
#
|
|
|
|
# Violations are reported inline with annotations.
|
|
|
|
#
|
|
|
|
# Performs the following steps:
|
|
|
|
# - Checks out the repository.
|
|
|
|
# - Sets up PHP.
|
|
|
|
# - Logs debug information about the runner container.
|
2021-01-05 19:21:50 +00:00
|
|
|
# - Installs Composer dependencies (use cache if possible).
|
|
|
|
# - Make Composer packages available globally.
|
2020-10-15 19:40:33 +00:00
|
|
|
# - Logs PHP_CodeSniffer debug information.
|
|
|
|
# - Runs the PHP compatibility tests.
|
|
|
|
# - todo: Configure Slack notifications for failing scans.
|
|
|
|
php-comatibility:
|
|
|
|
name: Check PHP compatibility
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-09 20:05:01 +00:00
|
|
|
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
|
2020-10-15 19:40:33 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: '7.4'
|
|
|
|
coverage: none
|
|
|
|
tools: composer, cs2pr
|
|
|
|
|
|
|
|
- name: Log debug information
|
|
|
|
run: |
|
|
|
|
php --version
|
|
|
|
composer --version
|
|
|
|
|
|
|
|
- name: Install Composer dependencies
|
2021-01-05 19:21:50 +00:00
|
|
|
uses: ramsey/composer-install@v1
|
|
|
|
with:
|
|
|
|
composer-options: "--no-progress --no-ansi --no-interaction"
|
|
|
|
|
|
|
|
- name: Make Composer packages available globally
|
|
|
|
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
|
2020-10-16 17:12:16 +00:00
|
|
|
|
|
|
|
- name: Log PHPCS debug information
|
|
|
|
run: phpcs -i
|
2020-10-15 19:40:33 +00:00
|
|
|
|
|
|
|
- name: Run PHP compatibility tests
|
2020-10-16 17:12:16 +00:00
|
|
|
run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
|