Update supported WordPress/PHP versions #278
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
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.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7'] | |
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2'] | |
include: | |
# WordPress 6.0: | |
- wordpress-version: '6.0' | |
php-versions: '7.3' | |
- wordpress-version: '6.0' | |
php-versions: '7.4' | |
- wordpress-version: '6.0' | |
php-versions: '8.0' | |
- wordpress-version: '6.0' | |
php-versions: '8.1' | |
# php 8.3: | |
- php-versions: '8.3' | |
wordpress-version: '6.7' | |
- php-versions: '8.3' | |
wordpress-version: '6.6' | |
- php-versions: '8.3' | |
wordpress-version: '6.5' | |
- php-versions: '8.3' | |
wordpress-version: '6.4' | |
# php 8.4: | |
- php-versions: '8.4' | |
wordpress-version: '6.7' | |
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.3 | |
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 |