Skip to content

DGR-964: Bump Tested up to version to 6.6 #351

DGR-964: Bump Tested up to version to 6.6

DGR-964: Bump Tested up to version to 6.6 #351

Workflow file for this run

## Linting and Unit Tests using phpcs and phpunit
name: "Linting and Unit Tests"
on:
workflow_dispatch:
push:
branches:
- develop
- master
pull_request:
branches: ['develop', 'master']
jobs:
unit_tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
strategy:
fail-fast: false
matrix:
include:
- php: '5.6'
composer: 1
wordpress: '6.2'
- php: '7.1'
composer: 1
wordpress: '6.5'
- php: '7.4'
composer: 2
wordpress: '6.6'
- php: '8.2'
composer: 2
wordpress: '6.6'
name: WP version ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: upload_max_filesize=512M
- name: Build Composer Version ${{ matrix.composer }}
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php }}
version: ${{ matrix.composer }}
command: update
- name: Initialise WP
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
run: |
git clone -b main https://github.com/WordPress/WordPress-Coding-Standards.git vendor/wp-coding-standards/wpcs
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global require wp-coding-standards/wpcs
composer global require phpcompatibility/phpcompatibility-paragonie
composer global require phpcompatibility/phpcompatibility-wp
composer global require phpcsstandards/phpcsutils
composer global require phpcsstandards/phpcsextra
sudo vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcompatibility/php-compatibility,vendor/phpcompatibility/phpcompatibility-paragonie,vendor/phpcompatibility/phpcompatibility-wp,vendor/phpcsstandards/phpcsutils,vendor/phpcsstandards/phpcsextra
vendor/bin/phpcs -i
bash bin/install-wp-tests.sh wordpress wordpress wordpress 127.0.0.1:${{ job.services.mysql.ports[3306] }} ${{ matrix.wordpress }} true
- name: Run PHP CodeSniffer
run: |
php --version
vendor/bin/phpcs --version
vendor/bin/phpcs -v
- name: Run PHP Unit Tests
run: |
vendor/bin/phpunit --version
vendor/bin/phpunit