Skip to content

Update supported WordPress/PHP versions #275

Update supported WordPress/PHP versions

Update supported WordPress/PHP versions #275

Workflow file for this run

on:
push:
branches:
- master
pull_request:
name: Tests
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# See: https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/
wordpress-version: ['6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
name: PHP:${{ matrix.php-versions }} / WP:${{ matrix.wordpress-version }}
services:
mariadb:
image: mariadb:10.11
env:
MARIADB_ROOT_PASSWORD: password
MARIADB_DATABASE: wordpress
ports:
- 3306
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: php-cs-fixer, composer
extensions: gmp
env:
fail-fast: true
- name: Setup Wordpress over phpunit
run: bash bin/install-wp-tests.sh wordpress root password 127.0.0.1:${{ job.services.mariadb.ports[3306] }} ${{ matrix.wordpress-version }} true
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Run the tests
run: vendor/bin/phpunit --debug
sync-trunk:
name: Sync trunk with master
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
tools: composer
env:
fail-fast: true
- name: Sync with SVN
run: |
make svnsync
- name: Push trunk to WordPress Plugin directory
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
run: |
make svnpush