Make WordPress Core


Ignore:
Timestamp:
06/03/2024 05:00:05 PM (20 months ago)
Author:
desrosj
Message:

Build/Test Tools: Make use of new reusable workflows for 6.3.

This updates the 6.3 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Removes the performance testing workflow. This workflow was overhauled in 6.4 to use Playwright. Continuing to support Puppeteer-based performance testing in 6.1-6.3 (which was historically very flaky) in a reusable workflow outweighs the benefit.
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.

Merges [57918], [58157], [57124], [57125], [57249] to the 6.3 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin.
Fixes #61340, #60822. See #61216, #60901, #61101, #59416, #59805, #61213.

Location:
branches/6.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.3

  • branches/6.3/.github/workflows/phpunit-tests.yml

    r56141 r58300  
    3131permissions: {}
    3232
    33 env:
    34   PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    35   LOCAL_PHP_MEMCACHED: ${{ false }}
    36 
    3733jobs:
    38   # Runs the PHPUnit tests for WordPress.
    3934  #
    40   # Performs the following steps:
    41   # - Sets environment variables.
    42   # - Checks out the repository.
    43   # - Sets up Node.js.
    44   # - Sets up PHP.
    45   # - Installs Composer dependencies.
    46   # - Installs npm dependencies
    47   # - Logs general debug information about the runner.
    48   # - Logs Docker debug information (about the Docker installation within the runner).
    49   # - Starts the WordPress Docker container.
    50   # - Logs the running Docker containers.
    51   # - Logs debug information about what's installed within the WordPress Docker containers.
    52   # - Install WordPress within the Docker container.
    53   # - Run the PHPUnit tests.
    54   # - Ensures version-controlled files are not modified or deleted.
    55   # - Checks out the WordPress Test reporter repository.
    56   # - Submit the test results to the WordPress.org host test results.
     35  # Creates a PHPUnit test job for each PHP/MySQL combination.
     36  #
    5737  test-php:
    5838    name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
    59     runs-on: ${{ matrix.os }}
     39    uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@trunk
    6040    permissions:
    6141      contents: read
    62     timeout-minutes: 20
     42    secrets: inherit
    6343    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    6444    strategy:
    6545      fail-fast: false
    6646      matrix:
     47        os: [ ubuntu-latest ]
    6748        php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
    68         os: [ ubuntu-latest ]
     49        db-type: [ 'mysql' ]
     50        db-version: [ '5.7' ]
     51        multisite: [ false, true ]
    6952        memcached: [ false ]
    70         multisite: [ false, true ]
     53
    7154        include:
    7255          # Include jobs for PHP 7.4 with memcached.
    73           - php: '7.4'
    74             os: ubuntu-latest
     56          - os: ubuntu-latest
     57            php: '7.4'
     58            db-type: 'mysql'
     59            db-version: '5.7'
     60            multisite: false
    7561            memcached: true
     62          - os: ubuntu-latest
     63            php: '7.4'
     64            db-type: 'mysql'
     65            db-version: '5.7'
     66            multisite: true
     67            memcached: true
     68          # Report the results of the PHP 7.4 without memcached job.
     69          - os: ubuntu-latest
     70            php: '7.4'
     71            db-type: 'mysql'
     72            db-version: '5.7'
    7673            multisite: false
    77           - php: '7.4'
    78             os: ubuntu-latest
    79             memcached: true
    80             multisite: true
    81           # Report the results of the PHP 7.4 without memcached job.
    82           - php: '7.4'
    83             os: ubuntu-latest
    8474            memcached: false
    85             multisite: false
    8675            report: true
    87 
    88     env:
    89       LOCAL_PHP: ${{ matrix.php }}-fpm
    90       LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }}
    91       PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
    92 
    93     steps:
    94       - name: Configure environment variables
    95         run: |
    96           echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
    97           echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
    98 
    99       - name: Checkout repository
    100         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    101 
    102       - name: Set up Node.js
    103         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    104         with:
    105           node-version-file: '.nvmrc'
    106           cache: npm
    107 
    108       ##
    109       # This allows Composer dependencies to be installed using a single step.
    110       #
    111       # Since the tests are currently run within the Docker containers where the PHP version varies,
    112       # the same PHP version needs to be configured for the action runner machine so that the correct
    113       # dependency versions are installed and cached.
    114       ##
    115       - name: Set up PHP
    116         uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
    117         with:
    118           php-version: '${{ matrix.php }}'
    119           coverage: none
    120 
    121       # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
    122       # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    123       - name: Install Composer dependencies
    124         uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    125         with:
    126           custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
    127 
    128       - name: Install npm dependencies
    129         run: npm ci
    130 
    131       - name: General debug information
    132         run: |
    133           npm --version
    134           node --version
    135           curl --version
    136           git --version
    137           svn --version
    138           composer --version
    139           locale -a
    140 
    141       - name: Docker debug information
    142         run: |
    143           docker -v
    144           docker-compose -v
    145 
    146       - name: Start Docker environment
    147         run: |
    148           npm run env:start
    149 
    150       - name: Log running Docker containers
    151         run: docker ps -a
    152 
    153       - name: WordPress Docker container debug information
    154         run: |
    155           docker-compose run --rm mysql mysql --version
    156           docker-compose run --rm php php --version
    157           docker-compose run --rm php php -m
    158           docker-compose run --rm php php -i
    159           docker-compose run --rm php locale -a
    160 
    161       - name: Install WordPress
    162         run: npm run env:install
    163 
    164       - name: Run PHPUnit tests
    165         run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
    166 
    167       - name: Run AJAX tests
    168         run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
    169 
    170       - name: Run ms-files tests as a multisite install
    171         if: ${{ matrix.multisite }}
    172         run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
    173 
    174       - name: Run external HTTP tests
    175         if: ${{ ! matrix.multisite }}
    176         run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
    177 
    178       # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
    179       - name: Run (Xdebug) tests
    180         run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
    181 
    182       - name: Ensure version-controlled files are not modified or deleted
    183         run: git diff --exit-code
    184 
    185       - name: Checkout the WordPress Test Reporter
    186         if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    187         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    188         with:
    189           repository: 'WordPress/phpunit-test-runner'
    190           path: 'test-runner'
    191 
    192       - name: Submit test results to the WordPress.org host test results
    193         if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    194         env:
    195           WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
    196         run: docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
     76    with:
     77      os: ${{ matrix.os }}
     78      php: ${{ matrix.php }}
     79      db-type: ${{ matrix.db-type }}
     80      db-version: ${{ matrix.db-version }}
     81      multisite: ${{ matrix.multisite }}
     82      memcached: ${{ matrix.memcached }}
     83      phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
     84      report: ${{ matrix.report || false }}
    19785
    19886  slack-notifications:
     
    229117    steps:
    230118      - name: Dispatch workflow run
    231         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     119        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    232120        with:
    233121          retries: 2
Note: See TracChangeset for help on using the changeset viewer.