Make WordPress Core

Changeset 58276


Ignore:
Timestamp:
05/31/2024 07:23:44 PM (8 weeks ago)
Author:
desrosj
Message:

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

This updates the 6.4 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:

  • 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.4 branch.

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

Location:
branches/6.4
Files:
2 deleted
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/6.4

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

    r57002 r58276  
    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' }}
    7055
    71     steps:
    72       - name: Checkout repository
    73         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    74         with:
    75           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    76 
    77       - name: Set up PHP
    78         uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2.25.4
    79         with:
    80           php-version: 'latest'
    81           coverage: none
    82           tools: cs2pr
    83 
    84       # This date is used to ensure that the PHPCS cache is cleared at least once every week.
    85       # http://man7.org/linux/man-pages/man1/date.1.html
    86       - name: "Get last Monday's date"
    87         id: get-date
    88         run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    89 
    90       - name: Cache PHPCS scan cache
    91         uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
    92         with:
    93           path: |
    94             .cache/phpcs-src.json
    95             .cache/phpcs-tests.json
    96           key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
    97 
    98       # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
    99       # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    100       - name: Install Composer dependencies
    101         uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    102         with:
    103           custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    104 
    105       - name: Make Composer packages available globally
    106         run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    107 
    108       - name: Run PHPCS on all Core files
    109         id: phpcs-core
    110         run: phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml
    111 
    112       - name: Show PHPCS results in PR
    113         if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
    114         run: cs2pr ./.cache/phpcs-report.xml
    115 
    116       - name: Check test suite files for warnings
    117         id: phpcs-tests
    118         run: phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml
    119 
    120       - name: Show test suite scan results in PR
    121         if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
    122         run: cs2pr ./.cache/phpcs-tests-report.xml
    123 
    124       - name: Ensure version-controlled files are not modified during the tests
    125         run: git diff --exit-code
    126 
    12756  # Runs the JavaScript coding standards checks.
    128   #
    129   # JSHint violations are not currently reported inline with annotations.
    130   #
    131   # Performs the following steps:
    132   # - Checks out the repository.
    133   # - Sets up Node.js.
    134   # - Logs debug information about the GitHub Action runner.
    135   # - Installs npm dependencies.
    136   # - Run the WordPress JSHint checks.
    137   # - Ensures version-controlled files are not modified or deleted.
    13857  jshint:
    13958    name: JavaScript coding standards
    140     runs-on: ubuntu-latest
     59    uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
    14160    permissions:
    14261      contents: read
    143     timeout-minutes: 20
    14462    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    145     env:
    146       PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
    147 
    148     steps:
    149       - name: Checkout repository
    150         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    151         with:
    152           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    153 
    154       - name: Set up Node.js
    155         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    156         with:
    157           node-version-file: '.nvmrc'
    158           cache: npm
    159 
    160       - name: Log debug information
    161         run: |
    162           npm --version
    163           node --version
    164           git --version
    165           svn --version
    166 
    167       - name: Install npm Dependencies
    168         run: npm ci
    169 
    170       - name: Run JSHint
    171         run: npm run grunt jshint
    172 
    173       - name: Ensure version-controlled files are not modified or deleted
    174         run: git diff --exit-code
    17563
    17664  slack-notifications:
     
    20896    steps:
    20997      - name: Dispatch workflow run
    210         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     98        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    21199        with:
    212100          retries: 2
  • branches/6.4/.github/workflows/end-to-end-tests.yml

    r56954 r58276  
    3737jobs:
    3838  # Runs the end-to-end test suite.
    39   #
    40   # Performs the following steps:
    41   # - Sets environment variables.
    42   # - Checks out the repository.
    43   # - Sets up Node.js.
    44   # - Logs debug information about the GitHub Action runner.
    45   # - Installs npm dependencies.
    46   # - Install Playwright browsers.
    47   # - Builds WordPress to run from the `build` directory.
    48   # - Starts the WordPress Docker container.
    49   # - Logs the running Docker containers.
    50   # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
    51   # - Install WordPress within the Docker container.
    52   # - Install Gutenberg.
    53   # - Run the E2E tests.
    54   # - Ensures version-controlled files are not modified or deleted.
    5539  e2e-tests:
    56     name: E2E Tests with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
    57     runs-on: ubuntu-latest
     40    name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
     41    uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk
    5842    permissions:
    5943      contents: read
    60     timeout-minutes: 20
    6144    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    6245    strategy:
     
    6447      matrix:
    6548        LOCAL_SCRIPT_DEBUG: [ true, false ]
    66 
    67     steps:
    68       - name: Configure environment variables
    69         run: |
    70           echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
    71           echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
    72 
    73       - name: Checkout repository
    74         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    75         with:
    76           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    77 
    78       - name: Set up Node.js
    79         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    80         with:
    81           node-version-file: '.nvmrc'
    82           cache: npm
    83 
    84       - name: Log debug information
    85         run: |
    86           npm --version
    87           node --version
    88           curl --version
    89           git --version
    90           svn --version
    91           locale -a
    92 
    93       - name: Install npm Dependencies
    94         run: npm ci
    95 
    96       - name: Install Playwright browsers
    97         run: npx playwright install --with-deps
    98 
    99       - name: Build WordPress
    100         run: npm run build
    101 
    102       - name: Start Docker environment
    103         run: |
    104           npm run env:start
    105 
    106       - name: Log running Docker containers
    107         run: docker ps -a
    108 
    109       - name: Docker debug information
    110         run: |
    111           docker -v
    112           docker-compose -v
    113           docker-compose run --rm mysql mysql --version
    114           docker-compose run --rm php php --version
    115           docker-compose run --rm php php -m
    116           docker-compose run --rm php php -i
    117           docker-compose run --rm php locale -a
    118 
    119       - name: Install WordPress
    120         env:
    121           LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
    122         run: npm run env:install
    123 
    124       - name: Install Gutenberg
    125         run: npm run env:cli -- plugin install gutenberg --path=/var/www/${{ env.LOCAL_DIR }}
    126 
    127       - name: Run E2E tests
    128         run: npm run test:e2e
    129 
    130       - name: Archive debug artifacts (screenshots, HTML snapshots)
    131         uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
    132         if: always()
    133         with:
    134             name: failures-artifacts
    135             path: artifacts
    136             if-no-files-found: ignore
    137 
    138       - name: Ensure version-controlled files are not modified or deleted
    139         run: git diff --exit-code
     49    with:
     50      LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }}
    14051
    14152  slack-notifications:
     
    17283    steps:
    17384      - name: Dispatch workflow run
    174         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     85        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    17586        with:
    17687          retries: 2
  • branches/6.4/.github/workflows/javascript-tests.yml

    r57002 r58276  
    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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    66         with:
    67           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    68 
    69       - name: Set up Node.js
    70         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    71         with:
    72           node-version-file: '.nvmrc'
    73           cache: npm
    74 
    75       - name: Log debug information
    76         run: |
    77           npm --version
    78           node --version
    79           git --version
    80           svn --version
    81 
    82       - name: Install npm Dependencies
    83         run: npm ci
    84 
    85       - name: Run QUnit tests
    86         run: npm run grunt qunit:compiled
    87 
    88       - name: Ensure version-controlled files are not modified or deleted
    89         run: git diff --exit-code
    9053
    9154  slack-notifications:
     
    12386    steps:
    12487      - name: Dispatch workflow run
    125         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     88        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    12689        with:
    12790          retries: 2
  • branches/6.4/.github/workflows/performance.yml

    r58272 r58276  
    3030permissions: {}
    3131
    32 env:
    33   PUPPETEER_SKIP_DOWNLOAD: ${{ true }}
    34 
    35   # Performance testing should be performed in an environment reflecting a standard production environment.
    36   LOCAL_WP_DEBUG: false
    37   LOCAL_SCRIPT_DEBUG: false
    38   LOCAL_SAVEQUERIES: false
    39   LOCAL_WP_DEVELOPMENT_MODE: "''"
    40   LOCAL_PHP: "8.2-fpm"
    41 
    42   # This workflow takes two sets of measurements — one for the current commit,
    43   # and another against a consistent version that is used as a baseline measurement.
    44   # This is done to isolate variance in measurements caused by the GitHub runners
    45   # from differences caused by code changes between commits. The BASE_TAG value here
    46   # represents the version being used for baseline measurements. It should only be
    47   # changed if we want to normalize results against a different baseline.
    48   BASE_TAG: '6.1.1'
    49   LOCAL_DIR: build
    50   TARGET_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || '' }}
    51   TARGET_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
    52 
    5332jobs:
    5433  # Runs the performance test suite.
    55   #
    56   # Performs the following steps:
    57   # - Configure environment variables.
    58   # - Checkout repository.
    59   # - Set up Node.js.
    60   # - Log debug information.
    61   # - Install npm dependencies.
    62   # - Install Playwright browsers.
    63   # - Build WordPress.
    64   # - Start Docker environment.
    65   # - Log running Docker containers.
    66   # - Docker debug information.
    67   # - Install WordPress.
    68   # - Install WordPress Importer plugin.
    69   # - Import mock data.
    70   # - Update permalink structure.
    71   # - Install MU plugin.
    72   # - Run performance tests (current commit).
    73   # - Print performance tests results.
    74   # - Check out target commit (target branch or previous commit).
    75   # - Switch Node.js versions if necessary.
    76   # - Install npm dependencies.
    77   # - Build WordPress.
    78   # - Run performance tests (previous/target commit).
    79   # - Print target performance tests results.
    80   # - Reset to original commit.
    81   # - Switch Node.js versions if necessary.
    82   # - Install npm dependencies.
    83   # - Set the environment to the baseline version.
    84   # - Run baseline performance tests.
    85   # - Print baseline performance tests results.
    86   # - Compare results with base.
    87   # - Add workflow summary.
    88   # - Set the base sha.
    89   # - Set commit details.
    90   # - Publish performance results.
    91   # - Ensure version-controlled files are not modified or deleted.
    92   # - Dispatch workflow run.
    9334  performance:
    9435    name: Run performance tests
    95     runs-on: ubuntu-latest
     36    uses: WordPress/wordpress-develop/.github/workflows/reusable-performance.yml@trunk
    9637    permissions:
    9738      contents: read
    98     if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    99 
    100     steps:
    101       - name: Configure environment variables
    102         run: |
    103           echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
    104           echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
    105 
    106       - name: Checkout repository
    107         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    108         with:
    109           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    110 
    111       - name: Set up Node.js
    112         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    113         with:
    114           node-version-file: '.nvmrc'
    115           cache: npm
    116 
    117       - name: Log debug information
    118         run: |
    119           npm --version
    120           node --version
    121           curl --version
    122           git --version
    123           svn --version
    124           locale -a
    125 
    126       - name: Install npm dependencies
    127         run: npm ci
    128 
    129       - name: Install Playwright browsers
    130         run: npx playwright install --with-deps
    131 
    132       - name: Build WordPress
    133         run: npm run build
    134 
    135       - name: Start Docker environment
    136         run: |
    137           npm run env:start
    138 
    139       - name: Log running Docker containers
    140         run: docker ps -a
    141 
    142       - name: Docker debug information
    143         run: |
    144           docker -v
    145           docker-compose -v
    146           docker-compose run --rm mysql mysql --version
    147           docker-compose run --rm php php --version
    148           docker-compose run --rm php php -m
    149           docker-compose run --rm php php -i
    150           docker-compose run --rm php locale -a
    151 
    152       - name: Install WordPress
    153         run: npm run env:install
    154 
    155       - name: Install WordPress Importer plugin
    156         run: npm run env:cli -- plugin install wordpress-importer --activate --path=/var/www/${{ env.LOCAL_DIR }}
    157 
    158       - name: Import mock data
    159         run: |
    160           curl -O https://raw.githubusercontent.com/WordPress/theme-test-data/b9752e0533a5acbb876951a8cbb5bcc69a56474c/themeunittestdata.wordpress.xml
    161           npm run env:cli -- import themeunittestdata.wordpress.xml --authors=create --path=/var/www/${{ env.LOCAL_DIR }}
    162           rm themeunittestdata.wordpress.xml
    163 
    164       - name: Update permalink structure
    165         run: |
    166           npm run env:cli -- rewrite structure '/%year%/%monthnum%/%postname%/' --path=/var/www/${{ env.LOCAL_DIR }}
    167 
    168       - name: Install MU plugin
    169         run: |
    170           mkdir ./${{ env.LOCAL_DIR }}/wp-content/mu-plugins
    171           cp ./tests/performance/wp-content/mu-plugins/server-timing.php ./${{ env.LOCAL_DIR }}/wp-content/mu-plugins/server-timing.php
    172 
    173       - name: Run performance tests (current commit)
    174         run: npm run test:performance
    175 
    176       - name: Print performance tests results
    177         run: node ./tests/performance/results.js
    178 
    179       - name: Check out target commit (target branch or previous commit)
    180         run: |
    181           if [[ -z "$TARGET_REF" ]]; then
    182             git fetch -n origin $TARGET_SHA
    183           else
    184             git fetch -n origin $TARGET_REF
    185           fi
    186           git reset --hard $TARGET_SHA
    187 
    188       - name: Set up Node.js
    189         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    190         with:
    191           node-version-file: '.nvmrc'
    192           cache: npm
    193 
    194       - name: Install npm dependencies
    195         run: npm ci
    196 
    197       - name: Build WordPress
    198         run: npm run build
    199 
    200       - name: Run target performance tests (base/previous commit)
    201         env:
    202           TEST_RESULTS_PREFIX: before
    203         run: npm run test:performance
    204 
    205       - name: Print target performance tests results
    206         env:
    207           TEST_RESULTS_PREFIX: before
    208         run: node ./tests/performance/results.js
    209 
    210       - name: Reset to original commit
    211         run: git reset --hard $GITHUB_SHA
    212 
    213       - name: Set up Node.js
    214         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    215         with:
    216           node-version-file: '.nvmrc'
    217           cache: npm
    218 
    219       - name: Install npm dependencies
    220         run: npm ci
    221 
    222       - name: Set the environment to the baseline version
    223         run: |
    224           npm run env:cli -- core update --version=${{ env.BASE_TAG }} --force --path=/var/www/${{ env.LOCAL_DIR }}
    225           npm run env:cli -- core version --path=/var/www/${{ env.LOCAL_DIR }}
    226 
    227       - name: Run baseline performance tests
    228         env:
    229           TEST_RESULTS_PREFIX: base
    230         run: npm run test:performance
    231 
    232       - name: Print baseline performance tests results
    233         env:
    234           TEST_RESULTS_PREFIX: base
    235         run: node ./tests/performance/results.js
    236 
    237       - name: Compare results with base
    238         run: node ./tests/performance/compare-results.js ${{ runner.temp }}/summary.md
    239 
    240       - name: Add workflow summary
    241         run: cat ${{ runner.temp }}/summary.md >> $GITHUB_STEP_SUMMARY
    242 
    243       - name: Set the base sha
    244         # Only needed when publishing results.
    245         if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }}
    246         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
    247         id: base-sha
    248         with:
    249             github-token: ${{ secrets.GITHUB_TOKEN }}
    250             script: |
    251                 const baseRef = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ env.BASE_TAG }}' });
    252                 return baseRef.data.object.sha;
    253 
    254       - name: Set commit details
    255         # Only needed when publishing results.
    256         if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }}
    257         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
    258         id: commit-timestamp
    259         with:
    260             github-token: ${{ secrets.GITHUB_TOKEN }}
    261             script: |
    262                 const commit_details = await github.rest.git.getCommit({ owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha });
    263                 return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
    264 
    265       - name: Publish performance results
    266         # Only publish results on pushes to trunk.
    267         if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }}
    268         env:
    269             BASE_SHA: ${{ steps.base-sha.outputs.result }}
    270             COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
    271             CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
    272             HOST_NAME: "www.codevitals.run"
    273         run: node ./tests/performance/log-results.js $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT $HOST_NAME
    274 
    275       - name: Ensure version-controlled files are not modified or deleted
    276         run: git diff --exit-code
     39    if: ${{ ( github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' ) && ! contains( github.event.before, '00000000' ) }}
     40    with:
     41      php-version: '8.2'
    27742
    27843  slack-notifications:
     
    31075    steps:
    31176      - name: Dispatch workflow run
    312         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     77        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    31378        with:
    31479          retries: 2
  • branches/6.4/.github/workflows/php-compatibility.yml

    r57002 r58276  
    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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    69         with:
    70           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    71 
    72       - name: Set up PHP
    73         uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2.25.4
    74         with:
    75           php-version: '7.4'
    76           coverage: none
    77           tools: cs2pr
    78 
    79       - name: Log debug information
    80         run: |
    81           composer --version
    82 
    83       # This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
    84       # http://man7.org/linux/man-pages/man1/date.1.html
    85       - name: "Get last Monday's date"
    86         id: get-date
    87         run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    88 
    89       - name: Cache PHP compatibility scan cache
    90         uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
    91         with:
    92           path: .cache/phpcompat.json
    93           key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
    94 
    95       # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
    96       # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    97       - name: Install Composer dependencies
    98         uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    99         with:
    100           custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    101 
    102       - name: Make Composer packages available globally
    103         run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    104 
    105       - name: Run PHP compatibility tests
    106         id: phpcs
    107         run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
    108 
    109       - name: Show PHPCompatibility results in PR
    110         if: ${{ always() && steps.phpcs.outcome == 'failure' }}
    111         run: cs2pr ./.cache/phpcs-compat-report.xml
    112 
    113       - name: Ensure version-controlled files are not modified or deleted
    114         run: git diff --exit-code
    11550
    11651  slack-notifications:
     
    14883    steps:
    14984      - name: Dispatch workflow run
    150         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     85        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    15186        with:
    15287          retries: 2
  • branches/6.4/.github/workflows/phpunit-tests.yml

    r57002 r58276  
    3232
    3333jobs:
    34   #
    3534  # Creates a PHPUnit test job for each PHP/MySQL combination.
    3635  #
    3736  test-with-mysql:
    3837    name: PHP ${{ matrix.php }}
    39     uses: WordPress/wordpress-develop/.github/workflows/phpunit-tests-run.yml@trunk
     38    uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@trunk
    4039    permissions:
    4140      contents: read
     
    8988  test-with-mariadb:
    9089    name: PHP ${{ matrix.php }}
    91     uses: WordPress/wordpress-develop/.github/workflows/phpunit-tests-run.yml@trunk
     90    uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@trunk
    9291    permissions:
    9392      contents: read
     
    162161    steps:
    163162      - name: Dispatch workflow run
    164         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     163        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    165164        with:
    166165          retries: 2
  • branches/6.4/.github/workflows/test-build-processes.yml

    r58275 r58276  
    1 name: Test npm
     1name: Test Build Processes
    22
    33on:
     
    3838permissions: {}
    3939
    40 env:
    41   PUPPETEER_SKIP_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        include:
     54          # Only prepare artifacts for Playground once.
     55          - os: ubuntu-latest
     56            directory: 'build'
     57            prepare-playground: true
     58    with:
     59      os: ${{ matrix.os }}
     60      directory: ${{ matrix.directory }}
     61      prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }}
     62      test-emoji: false
    6863
    69     steps:
    70       - name: Checkout repository
    71         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    72         with:
    73           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    74 
    75       - name: Set up Node.js
    76         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    77         with:
    78           node-version-file: '.nvmrc'
    79           check-latest: true
    80           cache: npm
    81 
    82       - name: Log debug information
    83         run: |
    84           npm --version
    85           node --version
    86           curl --version
    87           git --version
    88           svn --version
    89 
    90       - name: Install npm Dependencies
    91         run: npm ci
    92 
    93       - name: Build WordPress in /src
    94         run: npm run build:dev
    95 
    96       - name: Clean after building in /src
    97         run: npm run grunt clean -- --dev
    98 
    99       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    100         run: git diff --exit-code
    101 
    102       - name: Build WordPress
    103         run: npm run build
    104 
    105       - name: Clean after building
    106         run: npm run grunt clean
    107 
    108       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    109         run: git diff --exit-code
    110 
    111   # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     64  # Tests the WordPress Core build process on MacOS.
    11265  #
    113   # This is separate from the job above in order to use stricter conditions about when to run.
     66  # This is separate from the job above in order to use stricter conditions when determining when to run.
    11467  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    11568  #
     
    11770  # currently no way to determine the OS being used on a given job.
    11871  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    119   #
    120   # Performs the following steps:
    121   # - Checks out the repository.
    122   # - Sets up Node.js.
    123   # - Logs debug information about the GitHub Action runner.
    124   # - Installs npm dependencies.
    125   # - Builds WordPress to run from the `build` directory.
    126   # - Cleans up after building WordPress to the `build` directory.
    127   # - Ensures version-controlled files are not modified or deleted.
    128   # - Builds WordPress to run from the `src` directory.
    129   # - Cleans up after building WordPress to the `src` directory.
    130   # - Ensures version-controlled files are not modified or deleted.
    131   test-npm-macos:
    132     name: Test npm on MacOS
    133     runs-on: macos-latest
     72  test-core-build-process-macos:
     73    name: Core running from ${{ matrix.directory }}
     74    uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
    13475    permissions:
    13576      contents: read
    136     timeout-minutes: 30
    13777    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    138     steps:
    139       - name: Checkout repository
    140         uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
    141         with:
    142           show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
    143 
    144       - name: Set up Node.js
    145         uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
    146         with:
    147           node-version-file: '.nvmrc'
    148           check-latest: true
    149           cache: npm
    150 
    151       - name: Log debug information
    152         run: |
    153           npm --version
    154           node --version
    155           curl --version
    156           git --version
    157           svn --version
    158 
    159       - name: Install npm Dependencies
    160         run: npm ci
    161 
    162       - name: Build WordPress in /src
    163         run: npm run build:dev
    164 
    165       - name: Clean after building in /src
    166         run: npm run grunt clean -- --dev
    167 
    168       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    169         run: git diff --exit-code
    170 
    171       - name: Build WordPress
    172         run: npm run build
    173 
    174       - name: Clean after building
    175         run: npm run grunt clean
    176 
    177       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    178         run: git diff --exit-code
     78    strategy:
     79      fail-fast: false
     80      matrix:
     81        os: [ macos-latest ]
     82        directory: [ 'src', 'build' ]
     83    with:
     84      os: ${{ matrix.os }}
     85      directory: ${{ matrix.directory }}
     86      test-emoji: false
    17987
    18088  slack-notifications:
     
    18492      actions: read
    18593      contents: read
    186     needs: [ test-npm, test-npm-macos ]
     94    needs: [ test-core-build-process, test-core-build-process-macos ]
    18795    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    18896    with:
     
    212120    steps:
    213121      - name: Dispatch workflow run
    214         uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
     122        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
    215123        with:
    216124          retries: 2
  • branches/6.4/docker-compose.yml

    r57862 r58276  
    1 version: '3.7'
    2 
    31services:
    42
  • branches/6.4/tools/local-env/scripts/docker.js

    r54096 r58276  
    66
    77// Execute any docker-compose command passed to this script.
    8 execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
     8execSync( 'docker compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
  • branches/6.4/tools/local-env/scripts/install.js

    r56042 r58276  
    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.4/tools/local-env/scripts/start.js

    r55473 r58276  
    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.