diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index f343710ca6..5d6fdc1440 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -129,21 +129,26 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - php: [ '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6.20' ] + php: [ '5.6' ] + phpunit: [ '4-php-5.6' ] os: [ ubuntu-latest ] memcached: [ false ] include: - # Include job for PHP 7.4 with memcached. - - php: '7.4' - os: ubuntu-latest - memcached: true - # Report the results of the PHP 7.4 without memcached job. - - php: '7.4' + - php: '5.5' + phpunit: '5.5' + os: ubuntu-latest + memcached: false + - php: '5.4' + phpunit: '5.4' + os: ubuntu-latest + memcached: false + - php: '5.3' + phpunit: '5.3' os: ubuntu-latest memcached: false - report: true env: LOCAL_PHP: ${{ matrix.php }}-fpm + LOCAL_PHPUNIT: ${{ matrix.phpunit }}-fpm LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }} steps: @@ -179,13 +184,8 @@ jobs: - name: Install Dependencies run: npx install-changed --install-command="npm ci" - - name: Get composer cache directory - id: composer-cache - if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }} - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache Composer dependencies - if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }} + if: ${{ env.COMPOSER_INSTALL == true }} uses: actions/cache@v2 env: cache-name: cache-composer-dependencies @@ -196,19 +196,10 @@ jobs: ${{ runner.os }}-php-${{ matrix.php }}-composer- - name: Install Composer dependencies - if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }} + if: ${{ env.COMPOSER_INSTALL == true }} run: | docker-compose run --rm php composer --version - - # The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated, - # as PHPUnit 7 is no longer supported. The Composer-installed PHPUnit should be - # used for PHP 8 testing instead. - if [ ${{ env.LOCAL_PHP }} == '8.0-fpm' ]; then - docker-compose run --rm php composer install --ignore-platform-reqs - echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV - else - docker-compose run --rm php composer install - fi + docker-compose run --rm php composer install - name: Docker debug information run: | @@ -266,11 +257,8 @@ jobs: - name: Run REST API tests run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient - # Xdebug supports PHP 8 only from version 3.0, which is not released yet. - # Once Xdebug 3.0 is released and included in the Docker image, the IF condition should be removed. # __fakegroup__ is excluded to force PHPUnit to ignore the settings in phpunit.xml.dist. - name: Run (xDebug) tests - if: ${{ env.LOCAL_PHP != '8.0-fpm' }} run: LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__ - name: Checkout the WordPress Test Reporter