Skip to content

Test wp 6.2 and PHP 8.2 in workflow #183

Test wp 6.2 and PHP 8.2 in workflow

Test wp 6.2 and PHP 8.2 in workflow #183

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Test
on:
push:
branches:
- 'develop'
- 'trunk'
pull_request:
branches:
- '**'
jobs:
build:
strategy:
matrix:
php: ['8.1','8.0','7.4']
wp: ['6.2','6.1','6.0','5.6']
exclude:
- php: '8.0'
wp: '5.6'
- php: '8.1'
wp: '5.6'
fail-fast: false
name: WP ${{ matrix.wp }} / PHP ${{ matrix.php }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Composer cache
uses: actions/cache@v1
env:
cache-name: composer
with:
path: ~/.composer/cache
key: ${{ matrix.php }}-${{ env.cache-name }}-${{ hashFiles('composer.json') }}
- name: PHPCS and PHPStan cache
if: matrix.php == '7.4'
uses: actions/cache@v2
env:
cache-name: phpcs
with:
path: tests/cache
# This uses the hash of extended-cpts.php in its cache key because Actions doesn't support
# always pulling in a cache file and simultaneously always updating it, unlike Travis.
# This way we always pull in a cache file and refresh it with each new version of the plugin.
key: ${{ matrix.php }}-${{ env.cache-name }}-${{ hashFiles('extended-cpts.php') }}
- name: Install PHP
uses: shivammathur/setup-php@2.7.0
with:
php-version: ${{ matrix.php }}
extensions: mysqli, xmlwriter
coverage: none
- name: Debugging
run: |
php --version
php -m
composer --version
mysql --version
- name: Install dependencies
run: |
sudo systemctl start mysql.service
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress-full="~${{ matrix.wp }}.0"
mysqladmin -uroot -proot create wordpress_test
- name: Run the integration tests
run: composer test:integration
- name: Run the code sniffers
if: matrix.php == '7.4'
run: |
composer test:cs
composer test:analyze