Skip to content

Commit

Permalink
updating tests action on github
Browse files Browse the repository at this point in the history
  • Loading branch information
MocioF committed Mar 15, 2023
1 parent 84cab6e commit 4f780f4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
# See: https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/
wordpress-version: ['5.9', '6.0', '6.1']
php-versions: ['7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1']
exclude:
- php-versions: '8.0'
wordpress-version: '5.2'
Expand Down Expand Up @@ -66,20 +66,20 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Only for WP 5.9 / WP 6.0 and PHP 8
- name: Only for WP >= 5.9 Install Composer dependencies
# See: https://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-php-test-suite/
if: ${{ matrix.php-versions == '8.0' && ( matrix.wordpress-version == '5.9' || matrix.wordpress-version == '6.0' ) }}
run: (composer remove --dev phpunit/phpunit || true ) && composer update --dev yoast/phpunit-polyfills --with-dependencies && composer install --no-progress --prefer-dist --optimize-autoloader

if: ${{ ( matrix.wordpress-version == '5.9' || matrix.wordpress-version == '6.0' || matrix.wordpress-version == '6.1' ) }}
run: (composer remove --dev phpunit/phpunit || true ) && composer update --dev yoast/phpunit-polyfills --with-dependencies && composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs
- name: When using PHP 8 and WP <= 5.8
# See: https://core.trac.wordpress.org/ticket/50902
if: ${{ matrix.php-versions == '8.0' && (matrix.wordpress-version == '5.6' || matrix.wordpress-version == '5.7' || matrix.wordpress-version == '5.8' )}}
run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs

- name: Install Composer dependencies
#- name: Install Composer dependencies
# Rest of the versions
if: ${{ matrix.php-versions != '8.0' }}
run: composer install --no-progress --prefer-dist --optimize-autoloader
#if: ${{ matrix.php-versions != '8.0' }}
#run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run the tests
run: vendor/bin/phpunit --debug
Expand All @@ -92,7 +92,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down

0 comments on commit 4f780f4

Please # to comment.