Skip to content

Bump plugin version #160

Bump plugin version

Bump plugin version #160

Workflow file for this run

name: Build and Test
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: "Run Tests (PHP ${{ matrix.config.php }}, WP ${{ matrix.config.wp }}, multisite: ${{ matrix.config.ms }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- { wp: '5.5.x', ms: 'no', php: '7.4', phpunit: '7' }
- { wp: '5.5.x', ms: 'yes', php: '7.4', phpunit: '7' }
- { wp: '5.6.x', ms: 'no', php: '7.4', phpunit: '7' }
- { wp: '5.6.x', ms: 'yes', php: '7.4', phpunit: '7' }
- { wp: '5.7.x', ms: 'no', php: '7.4', phpunit: '7' }
- { wp: '5.7.x', ms: 'yes', php: '7.4', phpunit: '7' }
- { wp: '5.8.x', ms: 'no', php: '7.4', phpunit: '7' }
- { wp: '5.8.x', ms: 'yes', php: '7.4', phpunit: '7' }
- { wp: '5.9.x', ms: 'no', php: '7.4', phpunit: '7' }
- { wp: '5.9.x', ms: 'yes', php: '7.4', phpunit: '7' }
- { wp: latest, ms: 'no', php: '7.4', phpunit: '9' }
- { wp: latest, ms: 'yes', php: '7.4', phpunit: '9' }
- { wp: nightly, ms: 'no', php: '7.4', phpunit: '9' }
- { wp: nightly, ms: 'yes', php: '7.4', phpunit: '9' }
- { wp: latest, ms: 'no', php: '8.0', phpunit: '9', coverage: 'yes' }
- { wp: latest, ms: 'yes', php: '8.0', phpunit: '9', coverage: 'yes' }
- { wp: nightly, ms: 'no', php: '8.0', phpunit: '9' }
- { wp: nightly, ms: 'yes', php: '8.0', phpunit: '9' }
- { wp: latest, ms: 'no', php: '8.1', phpunit: '9' }
- { wp: latest, ms: 'yes', php: '8.1', phpunit: '9' }
- { wp: nightly, ms: 'no', php: '8.1', phpunit: '9' }
- { wp: nightly, ms: 'yes', php: '8.1', phpunit: '9' }
- { wp: latest, ms: 'no', php: '8.2', phpunit: '9' }
- { wp: latest, ms: 'yes', php: '8.2', phpunit: '9' }
- { wp: nightly, ms: 'no', php: '8.2', phpunit: '9' }
- { wp: nightly, ms: 'yes', php: '8.2', phpunit: '9' }
services:
mysql:
image: ghcr.io/automattic/vip-container-images/mariadb-lite:10.3
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: wordpress
MARIADB_INITDB_SKIP_TZINFO: 1
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
MYSQL_DATABASE: wordpress_test
memcached_1:
image: memcached:alpine
ports:
- "11211:11211"
memcached_2:
image: memcached:alpine
ports:
- "11212:11211"
steps:
- name: Check out source code
uses: actions/[email protected]
- name: Set up coverage reporting parameters
id: coverage
run: |
if [ "${{ matrix.config.coverage }}" = "yes" ]; then
echo "coverage=xdebug" >> $GITHUB_OUTPUT
else
echo "coverage=none" >> $GITHUB_OUTPUT
fi
- name: Set up PHP
uses: shivammathur/[email protected]
with:
coverage: ${{ steps.coverage.outputs.coverage }}
php-version: ${{ matrix.config.php }}
env:
fail-fast: 'true'
- name: Install PHPUnit
run: |
wget -q -O /usr/local/bin/phpunit "https://phar.phpunit.de/phpunit-${{ matrix.config.phpunit }}.phar"
chmod +x /usr/local/bin/phpunit
- name: Install PHP Dependencies
uses: ramsey/[email protected]
- name: Set up WordPress and WordPress Test Library
uses: sjinks/[email protected]
with:
version: ${{ matrix.config.wp }}
- name: Set up multisite mode
run: echo "WP_MULTISITE=1" >> $GITHUB_ENV
if: matrix.config.ms == 'yes'
- name: Verify MariaDB connection
run: mysqladmin ping -h 127.0.0.1 -P 3306 --silent
timeout-minutes: 1
- name: Run tests
run: |
OPTIONS=
if [ "${{ steps.coverage.outputs.coverage }}" != 'none' ]; then
OPTIONS="${OPTIONS} --coverage-clover=coverage/clover.xml"
fi
phpunit ${OPTIONS}
env:
MEMCACHED_HOST_1: 127.0.0.1:11211
MEMCACHED_HOST_2: 127.0.0.1:11212
- name: Upload coverage report
uses: codecov/codecov-action@v3
with:
files: coverage/clover.xml
flags: unittests
if: ${{ steps.coverage.outputs.coverage != 'none' }}