From bcee090b6e1d6fe1fef45d602741ca45d6056243 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Sun, 28 Jul 2024 19:11:41 -0700 Subject: [PATCH] Split PHPUnit test runs between single site and multisite in GH workflow. --- .github/workflows/php-lint.yml | 2 ++ .github/workflows/php-test.yml | 29 +++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/php-lint.yml b/.github/workflows/php-lint.yml index a7aae4e..ce63ffc 100644 --- a/.github/workflows/php-lint.yml +++ b/.github/workflows/php-lint.yml @@ -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 diff --git a/.github/workflows/php-test.yml b/.github/workflows/php-test.yml index f406912..b2471ff 100644 --- a/.github/workflows/php-test.yml +++ b/.github/workflows/php-test.yml @@ -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: @@ -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 }} @@ -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 @@ -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 \ No newline at end of file + - name: Running ${{ matrix.multisite && 'multisite' || 'single site' }} unit tests + run: npm run test-php${{ matrix.multisite && '-multisite' || '' }}