Skip to content

Trunk 3.0.32 (#2621) #528

Trunk 3.0.32 (#2621)

Trunk 3.0.32 (#2621) #528

name: PHP Unit Tests
on:
push:
branches:
- trunk
- develop
paths:
- "**.php"
- composer.json
- composer.lock
- .github/workflows/php-unit-tests.yml
pull_request:
paths:
- "**.php"
- composer.json
- composer.lock
- .github/workflows/php-unit-tests.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
UnitTests:
name: PHP unit tests - PHP ${{ matrix.php }}, WP ${{ matrix.wp-version }}
runs-on: ubuntu-latest
env:
WP_CORE_DIR: "/tmp/wordpress/src"
WP_TESTS_DIR: "/tmp/wordpress/tests/phpunit"
strategy:
matrix:
php: [7.4]
wp-version: [5.8, 5.9, latest]
include:
- php: 8.0
wp-version: latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare PHP
uses: woocommerce/grow/prepare-php@actions-v1
with:
php-version: "${{ matrix.php }}"
- name: Prepare MySQL
uses: woocommerce/grow/prepare-mysql@actions-v1
- name: Install WP tests
run: ./bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wp-version }}
- name: PHP8, PHPUnit9 with WordPress v5.9+
if: matrix.php >= 8
run: composer require phpunit/phpunit "^8" --dev --update-with-all-dependencies
- name: Run PHP unit tests
run: composer test-unit