Merge pull request #957 from ckoerner/patch-1 #332
Workflow file for this run
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
name: Integration Tests | |
on: [push] | |
jobs: | |
test: | |
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }} | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.allowed_failure }} | |
env: | |
WP_VERSION: ${{ matrix.wordpress }} | |
strategy: | |
matrix: | |
wordpress: [ '5.7', '6.2' ] | |
php: [ '7.1', '7.4', '8.0', '8.2' ] | |
allowed_failure: [ false ] | |
include: | |
- php: '8.2' | |
extensions: pcov | |
ini-values: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\"" | |
coverage: pcov | |
allowed_failure: false | |
- php: '8.2' | |
wordpress: 'trunk' | |
allowed_failure: true | |
exclude: | |
- php: '8.2' | |
wordpress: '5.7' | |
fail-fast: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up PHP ${{ matrix.php }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ matrix.extensions }} | |
ini-values: ${{ matrix.ini-values }} | |
coverage: ${{ matrix.coverage }} | |
- name: Install PHPUnit 7.x for WP < 5.9 | |
if: ${{ matrix.wordpress < 5.9 }} | |
# Ignore platform requirements, so that PHPUnit 7.5 can be installed on PHP 8.0 (and above). | |
run: composer require --dev phpunit/phpunit:"^7.5" --ignore-platform-req=php+ --no-update --no-scripts --no-interaction | |
- name: Install Composer dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
composer-options: --ignore-platform-req=php+ | |
- name: Set up problem matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: Set up problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Show PHP and PHPUnit version info | |
run: | | |
php --version | |
./vendor/bin/phpunit --version | |
- name: Start MySQL service | |
run: sudo systemctl start mysql.service | |
- name: Setting mysql_native_password for PHP <= 7.3 | |
if: ${{ matrix.php <= 7.3 }} | |
run: mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'"; | |
- name: Install WordPress environment | |
run: composer prepare ${{ matrix.wordpress }} | |
- name: Run integration tests (single site) | |
run: composer integration | |
- name: Run integration tests (multisite) | |
run: composer integration-ms |