Make WordPress Core

Changeset 58300


Ignore:
Timestamp:
06/03/2024 05:00:05 PM (6 weeks 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:
1 deleted
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/6.3

  • branches/6.3/.github/workflows/coding-standards.yml

    r55717 r58300  
    4747jobs:
    4848  # Runs PHP coding standards checks.
    49   #
    50   # Violations are reported inline with annotations.
    51   #
    52   # Performs the following steps:
    53   # - Checks out the repository.
    54   # - Sets up PHP.
    55   # - Configures caching for PHPCS scans.
    56   # - Installs Composer dependencies.
    57   # - Make Composer packages available globally.
    58   # - Runs PHPCS on the full codebase with warnings suppressed.
    59   # - Generate a report for displaying issues as pull request annotations.
    60   # - Runs PHPCS on the `tests` directory without warnings suppressed.
    61   # - Generate a report for displaying `test` directory issues as pull request annotations.
    62   # - Ensures version-controlled files are not modified or deleted.
    6349  phpcs:
    6450    name: PHP coding standards
    65     runs-on: ubuntu-latest
     51    uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk
    6652    permissions:
    6753      contents: read
    68     timeout-minutes: 20
    6954    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    70 
    71     steps:
    72       - name: Checkout repository
    73         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    74 
    75       - name: Set up PHP
    76         uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
    77         with:
    78           php-version: '7.4'
    79           coverage: none
    80           tools: cs2pr
    81 
    82       # This date is used to ensure that the PHPCS cache is cleared at least once every week.
    83       # http://man7.org/linux/man-pages/man1/date.1.html
    84       - name: "Get last Monday's date"
    85         id: get-date
    86         run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    87 
    88       - name: Cache PHPCS scan cache
    89         uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
    90         with:
    91           path: |
    92             .cache/phpcs-src.json
    93             .cache/phpcs-tests.json
    94           key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
    95 
    96       # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
    97       # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    98       - name: Install Composer dependencies
    99         uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    100         with:
    101           custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    102 
    103       - name: Make Composer packages available globally
    104         run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    105 
    106       - name: Run PHPCS on all Core files
    107         id: phpcs-core
    108         run: phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml
    109 
    110       - name: Show PHPCS results in PR
    111         if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
    112         run: cs2pr ./.cache/phpcs-report.xml
    113 
    114       - name: Check test suite files for warnings
    115         id: phpcs-tests
    116         run: phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml
    117 
    118       - name: Show test suite scan results in PR
    119         if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
    120         run: cs2pr ./.cache/phpcs-tests-report.xml
    121 
    122       - name: Ensure version-controlled files are not modified during the tests
    123         run: git diff --exit-code
     55    with:
     56      php-version: '7.4'
    12457
    12558  # Runs the JavaScript coding standards checks.
    126   #
    127   # JSHint violations are not currently reported inline with annotations.
    128   #
    129   # Performs the following steps:
    130   # - Checks out the repository.
    131   # - Sets up Node.js.
    132   # - Logs debug information about the GitHub Action runner.
    133   # - Installs npm dependencies.
    134   # - Run the WordPress JSHint checks.
    135   # - Ensures version-controlled files are not modified or deleted.
    13659  jshint:
    13760    name: JavaScript coding standards
    138     runs-on: ubuntu-latest
     61    uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
    13962    permissions:
    14063      contents: read
    141     timeout-minutes: 20
    14264    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    143     env:
    144       PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    145 
    146     steps:
    147       - name: Checkout repository
    148         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    149 
    150       - name: Set up Node.js
    151         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    152         with:
    153           node-version-file: '.nvmrc'
    154           cache: npm
    155 
    156       - name: Log debug information
    157         run: |
    158           npm --version
    159           node --version
    160           git --version
    161           svn --version
    162 
    163       - name: Install npm Dependencies
    164         run: npm ci
    165 
    166       - name: Run JSHint
    167         run: npm run grunt jshint
    168 
    169       - name: Ensure version-controlled files are not modified or deleted
    170         run: git diff --exit-code
    17165
    17266  slack-notifications:
     
    20498    steps:
    20599      - name: Dispatch workflow run
    206         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     100        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    207101        with:
    208102          retries: 2
  • branches/6.3/.github/workflows/end-to-end-tests.yml

    r56539 r58300  
    3636jobs:
    3737  # Runs the end-to-end test suite.
    38   #
    39   # Performs the following steps:
    40   # - Sets environment variables.
    41   # - Checks out the repository.
    42   # - Sets up Node.js.
    43   # - Logs debug information about the GitHub Action runner.
    44   # - Installs npm dependencies.
    45   # - Builds WordPress to run from the `build` directory.
    46   # - Starts the WordPress Docker container.
    47   # - Logs the running Docker containers.
    48   # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
    49   # - Install WordPress within the Docker container.
    50   # - Run the E2E tests.
    51   # - Ensures version-controlled files are not modified or deleted.
    5238  e2e-tests:
    53     name: E2E Tests with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
    54     runs-on: ubuntu-latest
     39    name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
     40    uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk
    5541    permissions:
    5642      contents: read
    57     timeout-minutes: 20
    5843    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    5944    strategy:
     
    6146      matrix:
    6247        LOCAL_SCRIPT_DEBUG: [ true, false ]
    63 
    64     steps:
    65       - name: Configure environment variables
    66         run: |
    67           echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
    68           echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
    69 
    70       - name: Checkout repository
    71         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    72 
    73       - name: Set up Node.js
    74         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    75         with:
    76           node-version-file: '.nvmrc'
    77           cache: npm
    78 
    79       - name: Log debug information
    80         run: |
    81           npm --version
    82           node --version
    83           curl --version
    84           git --version
    85           svn --version
    86           locale -a
    87 
    88       - name: Install npm Dependencies
    89         run: npm ci
    90 
    91       - name: Build WordPress
    92         run: npm run build
    93 
    94       - name: Start Docker environment
    95         run: |
    96           npm run env:start
    97 
    98       - name: Log running Docker containers
    99         run: docker ps -a
    100 
    101       - name: Docker debug information
    102         run: |
    103           docker -v
    104           docker-compose -v
    105           docker-compose run --rm mysql mysql --version
    106           docker-compose run --rm php php --version
    107           docker-compose run --rm php php -m
    108           docker-compose run --rm php php -i
    109           docker-compose run --rm php locale -a
    110 
    111       - name: Install WordPress
    112         env:
    113           LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
    114         run: npm run env:install
    115 
    116       - name: Run E2E tests
    117         run: npm run test:e2e
    118 
    119       - name: Archive debug artifacts (screenshots, HTML snapshots)
    120         uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
    121         if: always()
    122         with:
    123             name: failures-artifacts
    124             path: artifacts
    125             if-no-files-found: ignore
    126 
    127       - name: Ensure version-controlled files are not modified or deleted
    128         run: git diff --exit-code
     48    with:
     49      LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
     50      install-gutenberg: false
    12951
    13052  failed-workflow:
     
    14466    steps:
    14567      - name: Dispatch workflow run
    146         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     68        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    14769        with:
    14870          retries: 2
  • branches/6.3/.github/workflows/javascript-tests.yml

    r55717 r58300  
    4545jobs:
    4646  # Runs the QUnit tests for WordPress.
    47   #
    48   # Performs the following steps:
    49   # - Checks out the repository.
    50   # - Sets up Node.js.
    51   # - Logs debug information about the GitHub Action runner.
    52   # - Installs npm dependencies.
    53   # - Run the WordPress QUnit tests.
    54   # - Ensures version-controlled files are not modified or deleted.
    5547  test-js:
    5648    name: QUnit Tests
    57     runs-on: ubuntu-latest
     49    uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
    5850    permissions:
    5951      contents: read
    60     timeout-minutes: 20
    6152    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    62 
    63     steps:
    64       - name: Checkout repository
    65         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    66 
    67       - name: Set up Node.js
    68         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    69         with:
    70           node-version-file: '.nvmrc'
    71           cache: npm
    72 
    73       - name: Log debug information
    74         run: |
    75           npm --version
    76           node --version
    77           git --version
    78           svn --version
    79 
    80       - name: Install npm Dependencies
    81         run: npm ci
    82 
    83       - name: Run QUnit tests
    84         run: npm run grunt qunit:compiled
    85 
    86       - name: Ensure version-controlled files are not modified or deleted
    87         run: git diff --exit-code
    8853
    8954  slack-notifications:
     
    12085    steps:
    12186      - name: Dispatch workflow run
    122         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     87        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    12388        with:
    12489          retries: 2
  • branches/6.3/.github/workflows/php-compatibility.yml

    r55717 r58300  
    4141
    4242jobs:
    43 
    4443  # Runs PHP compatibility testing.
    45   #
    46   # Violations are reported inline with annotations.
    47   #
    48   # Performs the following steps:
    49   # - Checks out the repository.
    50   # - Sets up PHP.
    51   # - Logs debug information.
    52   # - Configures caching for PHP compatibility scans.
    53   # - Installs Composer dependencies.
    54   # - Make Composer packages available globally.
    55   # - Runs the PHP compatibility tests.
    56   # - Generate a report for displaying issues as pull request annotations.
    57   # - Ensures version-controlled files are not modified or deleted.
    5844  php-compatibility:
    5945    name: Check PHP compatibility
    60     runs-on: ubuntu-latest
     46    uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk
    6147    permissions:
    6248      contents: read
    63     timeout-minutes: 20
    6449    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    65 
    66     steps:
    67       - name: Checkout repository
    68         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    69 
    70       - name: Set up PHP
    71         uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
    72         with:
    73           php-version: '7.4'
    74           coverage: none
    75           tools: cs2pr
    76 
    77       - name: Log debug information
    78         run: |
    79           composer --version
    80 
    81       # This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
    82       # http://man7.org/linux/man-pages/man1/date.1.html
    83       - name: "Get last Monday's date"
    84         id: get-date
    85         run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    86 
    87       - name: Cache PHP compatibility scan cache
    88         uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
    89         with:
    90           path: .cache/phpcompat.json
    91           key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
    92 
    93       # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
    94       # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    95       - name: Install Composer dependencies
    96         uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    97         with:
    98           custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    99 
    100       - name: Make Composer packages available globally
    101         run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    102 
    103       - name: Run PHP compatibility tests
    104         id: phpcs
    105         run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
    106 
    107       - name: Show PHPCompatibility results in PR
    108         if: ${{ always() && steps.phpcs.outcome == 'failure' }}
    109         run: cs2pr ./.cache/phpcs-compat-report.xml
    110 
    111       - name: Ensure version-controlled files are not modified or deleted
    112         run: git diff --exit-code
     50    with:
     51      php-version: '7.4'
    11352
    11453  slack-notifications:
     
    14584    steps:
    14685      - name: Dispatch workflow run
    147         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     86        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    14887        with:
    14988          retries: 2
  • 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
  • branches/6.3/.github/workflows/test-build-processes.yml

    r58299 r58300  
    1 name: Test npm
     1name: Test Build Processes
    22
    33on:
     
    3838permissions: {}
    3939
    40 env:
    41   PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    42 
    4340jobs:
    44   # Verifies that installing npm dependencies and building WordPress works as expected.
    45   #
    46   # Performs the following steps:
    47   # - Checks out the repository.
    48   # - Sets up Node.js.
    49   # - Logs debug information about the GitHub Action runner.
    50   # - Installs npm dependencies.
    51   # - Builds WordPress to run from the `build` directory.
    52   # - Cleans up after building WordPress to the `build` directory.
    53   # - Ensures version-controlled files are not modified or deleted.
    54   # - Builds WordPress to run from the `src` directory.
    55   # - Cleans up after building WordPress to the `src` directory.
    56   # - Ensures version-controlled files are not modified or deleted.
    57   test-npm:
    58     name: Test npm on ${{ matrix.os }}
    59     runs-on: ${{ matrix.os }}
     41  # Tests the WordPress Core build process on multiple operating systems.
     42  test-core-build-process:
     43    name: Core running from ${{ matrix.directory }}
     44    uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
    6045    permissions:
    6146      contents: read
    62     timeout-minutes: 20
    6347    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    6448    strategy:
     
    6650      matrix:
    6751        os: [ ubuntu-latest, windows-latest ]
     52        directory: [ 'src', 'build' ]
     53    with:
     54      os: ${{ matrix.os }}
     55      directory: ${{ matrix.directory }}
     56      test-emoji: false
    6857
    69     steps:
    70       - name: Checkout repository
    71         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    72 
    73       - name: Set up Node.js
    74         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    75         with:
    76           node-version-file: '.nvmrc'
    77           cache: npm
    78 
    79       - name: Log debug information
    80         run: |
    81           npm --version
    82           node --version
    83           curl --version
    84           git --version
    85           svn --version
    86 
    87       - name: Install npm Dependencies
    88         run: npm ci
    89 
    90       - name: Build WordPress in /src
    91         run: npm run build:dev
    92 
    93       - name: Clean after building in /src
    94         run: npm run grunt clean -- --dev
    95 
    96       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    97         run: git diff --exit-code
    98 
    99       - name: Build WordPress
    100         run: npm run build
    101 
    102       - name: Clean after building
    103         run: npm run grunt clean
    104 
    105       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    106         run: git diff --exit-code
    107 
    108   # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     58  # Tests the WordPress Core build process on MacOS.
    10959  #
    110   # This is separate from the job above in order to use stricter conditions about when to run.
     60  # This is separate from the job above in order to use stricter conditions when determining when to run.
    11161  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    11262  #
     
    11464  # currently no way to determine the OS being used on a given job.
    11565  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    116   #
    117   # Performs the following steps:
    118   # - Checks out the repository.
    119   # - Sets up Node.js.
    120   # - Logs debug information about the GitHub Action runner.
    121   # - Installs npm dependencies.
    122   # - Builds WordPress to run from the `build` directory.
    123   # - Cleans up after building WordPress to the `build` directory.
    124   # - Ensures version-controlled files are not modified or deleted.
    125   # - Builds WordPress to run from the `src` directory.
    126   # - Cleans up after building WordPress to the `src` directory.
    127   # - Ensures version-controlled files are not modified or deleted.
    128   test-npm-macos:
    129     name: Test npm on MacOS
    130     runs-on: macos-latest
     66  test-core-build-process-macos:
     67    name: Core running from ${{ matrix.directory }}
     68    uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
    13169    permissions:
    13270      contents: read
    133     timeout-minutes: 30
    13471    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    135     steps:
    136       - name: Checkout repository
    137         uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    138 
    139       - name: Set up Node.js
    140         uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    141         with:
    142           node-version-file: '.nvmrc'
    143           cache: npm
    144 
    145       - name: Log debug information
    146         run: |
    147           npm --version
    148           node --version
    149           curl --version
    150           git --version
    151           svn --version
    152 
    153       - name: Install npm Dependencies
    154         run: npm ci
    155 
    156       - name: Build WordPress in /src
    157         run: npm run build:dev
    158 
    159       - name: Clean after building in /src
    160         run: npm run grunt clean -- --dev
    161 
    162       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    163         run: git diff --exit-code
    164 
    165       - name: Build WordPress
    166         run: npm run build
    167 
    168       - name: Clean after building
    169         run: npm run grunt clean
    170 
    171       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    172         run: git diff --exit-code
     72    strategy:
     73      fail-fast: false
     74      matrix:
     75        os: [ macos-13 ]
     76        directory: [ 'src', 'build' ]
     77    with:
     78      os: ${{ matrix.os }}
     79      directory: ${{ matrix.directory }}
     80      test-emoji: false
    17381
    17482  slack-notifications:
     
    17886      actions: read
    17987      contents: read
    180     needs: [ test-npm, test-npm-macos ]
     88    needs: [ test-core-build-process, test-core-build-process-macos ]
    18189    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    18290    with:
    183       calling_status: ${{ needs.test-npm.result == 'success' && needs.test-npm-macos.result == 'success' && 'success' || ( needs.test-npm.result == 'cancelled' || needs.test-npm-macos.result == 'cancelled' ) && 'cancelled' || 'failure' }}
     91      calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
    18492    secrets:
    18593      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    193101    permissions:
    194102      actions: write
    195     needs: [ test-npm, test-npm-macos, slack-notifications ]
     103    needs: [ slack-notifications ]
    196104    if: |
    197105      always() &&
     
    200108      github.run_attempt < 2 &&
    201109      (
    202         needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
    203         needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     110        contains( needs.*.result, 'cancelled' ) ||
     111        contains( needs.*.result, 'failure' )
    204112      )
    205113
    206114    steps:
    207115      - name: Dispatch workflow run
    208         uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     116        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    209117        with:
    210118          retries: 2
  • branches/6.3/docker-compose.yml

    r54096 r58300  
    1 version: '3.7'
    2 
    31services:
    42
     
    2624
    2725    depends_on:
    28       - php
     26      php:
     27        condition: service_started
     28      mysql:
     29        condition: service_healthy
    2930
    3031  ##
     
    5354    command: /bin/sh -c "if [ $LOCAL_PHP_MEMCACHED = true ]; then cp -n /var/www/tests/phpunit/includes/object-cache.php /var/www/src/wp-content/object-cache.php; else rm -f /var/www/src/wp-content/object-cache.php; fi && exec php-fpm"
    5455
    55     depends_on:
    56       - mysql
    57 
    5856    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
    5957    init: true
     
    6664  ##
    6765  mysql:
    68     image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest}
     66    image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest}
     67    platform: linux/amd64
    6968
    7069    networks:
     
    8382    # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0.
    8483    command: --default-authentication-plugin=mysql_native_password
     84
     85    healthcheck:
     86      test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ]
     87      timeout: 5s
     88      interval: 5s
     89      retries: 10
    8590
    8691  ##
     
    108113      - localhost:host-gateway
    109114
     115    depends_on:
     116      php:
     117        condition: service_started
     118      mysql:
     119        condition: service_healthy
     120
    110121  ##
    111122  # The Memcached container.
     
    120131      - 11211:11211
    121132
     133    depends_on:
     134      php:
     135        condition: service_started
     136
    122137volumes:
    123138  # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
  • branches/6.3/tools/local-env/scripts/docker.js

    r54096 r58300  
    55dotenvExpand.expand( dotenv.config() );
    66
    7 // Execute any docker-compose command passed to this script.
    8 execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
     7// Execute any docker compose command passed to this script.
     8execSync( 'docker compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
  • branches/6.3/tools/local-env/scripts/install.js

    r56042 r58300  
    4747 */
    4848function wp_cli( cmd ) {
    49     execSync( `docker-compose run --rm cli ${cmd}`, { stdio: 'inherit' } );
     49    execSync( `docker compose run --rm cli ${cmd}`, { stdio: 'inherit' } );
    5050}
    5151
     
    5656    const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer';
    5757
    58     execSync( `docker-compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } );
    59     execSync( `docker-compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
     58    execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } );
     59    execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
    6060}
  • branches/6.3/tools/local-env/scripts/start.js

    r55473 r58300  
    2020    ? 'wordpress-develop memcached'
    2121    : 'wordpress-develop';
    22 execSync( `docker-compose up -d ${containers}`, { stdio: 'inherit' } );
     22execSync( `docker compose up -d ${containers}`, { stdio: 'inherit' } );
    2323
    2424// If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.
Note: See TracChangeset for help on using the changeset viewer.