Refactor the remaining modules #387
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 tests | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
# Alias 'master' to 'latest' | |
name: WP ${{ matrix.wp == 'master' && 'latest' || matrix.wp }} and PHP ${{ matrix.php }} | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.allowed_failure }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Check lowest supported WP version, with the lowest supported PHP. | |
- php: '8.1' | |
wp: '6.4' | |
allowed_failure: false | |
# Check latest WP with the lowest supported PHP. | |
- php: '8.1' | |
wp: 'master' | |
allowed_failure: false | |
# Check latest WP with the highest supported PHP. | |
- php: '8.3' | |
wp: 'master' | |
allowed_failure: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install wordpress environment | |
run: npm -g install @wordpress/env | |
- name: Setup PHP ${{ matrix.php }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v3 | |
with: | |
composer-options: --prefer-dist --no-progress | |
- name: Setup wp-env | |
run: wp-env start | |
env: | |
WP_ENV_CORE: WordPress/WordPress#${{ matrix.wp }} | |
WP_ENV_PHP_VERSION: ${{ matrix.php }} | |
- name: PHPUnit | |
run: composer test --no-interaction | |
- name: PHPUnit multisite | |
run: composer run-script test-multisite --no-interaction |