Skip to content

Commit

Permalink
Split PHPUnit test runs between single site and multisite in GH workf…
Browse files Browse the repository at this point in the history
…low.
  • Loading branch information
felixarntz committed Jul 29, 2024
1 parent c52628c commit bcee090
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate Composer configuration
run: composer validate
Expand Down
29 changes: 23 additions & 6 deletions .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ concurrency:

jobs:
php-test:
name: PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}${{ matrix.experimental && ' (experimental)' || '' }}
name: PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }} - ${{ matrix.multisite && 'Multisite' || 'Single site' }}${{ matrix.experimental && ' (experimental)' || '' }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
Expand All @@ -53,16 +53,34 @@ jobs:
- '8.1'
- '8.2'
wordpress: [ 'latest' ]
multisite: [ false, true ]
experimental: [false]
include:
- php: '5.6'
wordpress: '5.0'
multisite: false
- php: '5.6'
wordpress: '5.0'
multisite: true
- php: '5.6'
wordpress: '5.2'
multisite: false
- php: '5.6'
wordpress: '5.2'
multisite: true
- php: '7.0'
wordpress: '6.0'
multisite: false
- php: '7.0'
wordpress: '6.0'
multisite: true
- php: '8.2'
wordpress: 'trunk'
multisite: false
experimental: true
- php: '8.2'
wordpress: 'trunk'
multisite: true
experimental: true
env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}
Expand All @@ -76,6 +94,8 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@v4
Expand All @@ -101,8 +121,5 @@ jobs:
run: npm run wp-env run tests-wordpress -- sh -c "sed -i -e \"s/define('ABSPATH', dirname(__FILE__) . '\\/');/define( 'ABSPATH', '\\/var\\/www\\/html\\/' );\\n\\tdefine( 'WP_DEFAULT_THEME', 'default' );/\" /wordpress-phpunit/wp-tests-config.php"
if: startsWith(matrix.wordpress, '4.') || startsWith(matrix.wordpress, '5.0')

- name: Running PHPUnit tests
run: npm run test-php

- name: Running PHPUnit tests for multisite
run: npm run test-php-multisite
- name: Running ${{ matrix.multisite && 'multisite' || 'single site' }} unit tests
run: npm run test-php${{ matrix.multisite && '-multisite' || '' }}

0 comments on commit bcee090

Please sign in to comment.