Update dependency phpunit/phpunit to v11 #536
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: Test plugin | |
on: [push, pull_request] | |
jobs: | |
tag: | |
name: PHP ${{ matrix.php }} / WP ${{ matrix.wp }} Test | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: true | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: wordpress_test | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
matrix: | |
include: | |
- php: 8.0 | |
wp: latest | |
- php: 7.4 | |
wp: latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: PHP ${{ matrix.php }} / WP ${{ matrix.wp }} Test | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mbstring, intl , mysqli | |
ini-values: post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration | |
coverage: xdebug #optional, setup coverage driver | |
- name: Check PHP Version | |
run: php -v | |
- name: Install phpunit global | |
run: | | |
composer global require "phpunit/phpunit=7.*.*|8.*.*" | |
phpunit --version | |
- name: Cache composer packages | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: composer-${{ hashFiles('composer.lock') }} | |
- name: Composer install | |
run: | | |
composer install --optimize-autoloader --prefer-dist | |
composer fund | |
- name: Coding Style check | |
run: composer lint | |
- name: Install WP Tests | |
run: bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1 ${{ matrix.wp }} true | |
- name: phpunit tests | |
run: | | |
phpunit | |
WP_MULTISITE=1 phpunit |