Skip to content

Use correct WP version in tests, remove "latest" matrix run #189

Use correct WP version in tests, remove "latest" matrix run

Use correct WP version in tests, remove "latest" matrix run #189

Workflow file for this run

name: PHP Tests
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: WP ${{ 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: '7.4'
wp: '5.9'
allowed_failure: false
# Check latest WP with the highest supported PHP.
- php: 'latest'
wp: 'latest'
allowed_failure: false
steps:
- name: Checkout code
uses: actions/checkout@master
- 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 (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 || matrix.php == 'latest' }}
uses: ramsey/composer-install@v1
with:
composer-options: --ignore-platform-reqs
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Setup wp-env
run: wp-env start
env:
WP_ENV_CORE: WordPress/WordPress#${{ matrix.wp }}
- name: Run PHPUnit tests (single site)
run: composer integration
- name: Run PHPUnit tests (multisite)
run: composer integration-ms
# (previously before "Run PHPUnit tests (single site)")
- name: Run PHPCS diff tests
run: bash bin/phpcs-diff.sh