Add PHP 8.2 fixes (#700) #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Tests | |
on: push | |
jobs: | |
test: | |
name: WP ${{ matrix.wp }} and PHP ${{ matrix.php }} | |
# Ubuntu-20.x includes MySQL 8.0, which causes `caching_sha2_password` issues with PHP < 7.4 | |
# https://www.php.net/manual/en/mysqli.requirements.php | |
# TODO: change to ubuntu-latest when we no longer support PHP < 7.4 | |
runs-on: ubuntu-16.04 | |
continue-on-error: ${{ matrix.allowed_failure }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4' ] | |
wp: [ '5.6', '5.7' ] | |
allowed_failure: [ false ] | |
include: | |
- php: '8.0' | |
wp: '5.6' | |
allowed_failure: true | |
- php: '8.0' | |
wp: '5.7' | |
allowed_failure: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Setup PHP ${{ matrix.php }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: pcov | |
# https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions | |
extensions: curl, dom, exif, fileinfo, hash, json, mbstring, mysqli, libsodium, openssl, pcre, imagick, xml, zip | |
- name: Install Composer dependencies (PHP < 8.0 ) | |
if: ${{ matrix.php < 8.0 }} | |
uses: ramsey/composer-install@v1 | |
- name: Install Composer dependencies (PHP >= 8.0) | |
if: ${{ matrix.php >= 8.0 }} | |
uses: ramsey/composer-install@v1 | |
with: | |
composer-options: --ignore-platform-reqs | |
- name: Start MySQL service | |
run: sudo systemctl start mysql.service | |
- name: Install WordPress test site | |
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp }} | |
- name: Run PHPCS diff tests | |
# TODO: remove this condition when a new version of WPCS is released | |
# @see https://github.com/Automattic/Edit-Flow/issues/638#issuecomment-825511819 | |
if: ${{ matrix.php < 8.0 }} | |
run: bash bin/phpcs-diff.sh | |
- name: Run PHPUnit tests (single site) | |
run: composer integration | |
- name: Run PHPUnit tests (multisite) | |
run: composer integration-ms |