Add support for rich-text type #96
Workflow file for this run
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 Unit Tests | |
on: | |
push: | |
# Only run if PHP-related files changed. | |
paths: | |
- '**.php' | |
- 'phpunit.xml.dist' | |
- 'phpunit-multisite.xml.dist' | |
- 'composer.json' | |
- 'composer.lock' | |
- 'tests/**' | |
branches: | |
- master | |
- release/* | |
pull_request: | |
# Only run if PHP-related files changed. | |
paths: | |
- '**.php' | |
- 'phpunit.xml.dist' | |
- 'phpunit-multisite.xml.dist' | |
- 'composer.json' | |
- 'composer.lock' | |
- 'tests/**' | |
- '.github/workflows/tests-unit-php.yml' | |
jobs: | |
unit-php: | |
name: 'PHP ${{ matrix.php }} - WP ${{ matrix.wp }}' | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
services: | |
mysql: | |
image: mariadb:latest | |
env: | |
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true | |
MARIADB_DATABASE: wordpress_test | |
MARIADB_MYSQL_LOCALHOST_USER: 1 | |
MARIADB_MYSQL_LOCALHOST_GRANTS: USAGE | |
ports: | |
- 3306 | |
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 | |
continue-on-error: ${{ matrix.experimental == true }} | |
strategy: | |
matrix: | |
php: ['7.0', '7.2', '7.4', '8.0'] | |
wp: ['latest'] | |
include: | |
- php: '7.4' | |
wp: 'trunk' | |
experimental: true | |
- php: '8.1' | |
wp: 'trunk' | |
experimental: true | |
- php: '8.2' | |
wp: 'trunk' | |
experimental: true | |
- php: '8.3' | |
wp: 'trunk' | |
experimental: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Setup Composer cache | |
uses: pat-s/[email protected] | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
${{ runner.os }}- | |
- name: Setup PHP 8.0 | |
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d | |
with: | |
php-version: '8.0' | |
tools: composer | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: mysql | |
tools: composer, cs2pr | |
- name: Install dependencies | |
run: | | |
composer update yoast/wp-test-utils --with-all-dependencies --no-interaction | |
composer install --prefer-dist --no-suggest --no-progress --no-interaction --no-scripts --ignore-platform-reqs | |
composer dump-autoload --no-interaction | |
- name: Shutdown default MySQL service | |
run: sudo service mysql stop | |
- name: Verify MariaDB connection | |
run: | | |
while ! mysqladmin ping -h"127.0.0.1" -P"${{ job.services.mysql.ports[3306] }}" --silent; do | |
sleep 1 | |
done | |
- name: Set up tests | |
run: bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1:${{ job.services.mysql.ports['3306'] }} ${{ matrix.wp }} true | |
- name: Run tests | |
run: | | |
npm run test:php | |
npm run test:php:multisite |