Make WordPress Core

Changeset 55482


Ignore:
Timestamp:
03/07/2023 07:36:29 PM (23 months ago)
Author:
desrosj
Message:

Build/Test Tools: Backport updates to GitHub Actions.

This backports several changesets to GitHub Actions workflows. These changesets:

  • address the deprecated notices related to save-output and set-output to ensure the workflows continue to run after these are removed.
  • adds support for automatically retrying a failed workflow once.
  • backports some Docker environment related tooling updates for the sake of consistency across branches.

Merges [53628], [53636], [53736], [53737], [53895], [53940], [53947], [54039], [54096], [54108], [54293], [54297], [54313], [54342], [54343], [54371], [54373], [54511], [54649], [54650], [54674], [54678], [54750], [54851], [54852], [54856], [54921], [55152] to the 6.0 branch.
See 55702, #52708, #55652, #55652, #55700, #55652, #56407, #56407, #56528, #55652, #55652, #55652, #54695, #55652, #55652, #55652, #55652, #56820, #56820, #56816, #55652, #55652, #56820, #56793, #56793, #53841, #57148, #57572, #56682.

Location:
branches/6.0
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0/.env

    r53071 r55482  
    3636# Defaults to 5.7 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
    3737#
    38 # When using `mysql`, see https://hub.docker.com/_/mysql/ for valid versions.
    39 # When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
     38# When using `mysql`, see https://hub.docker.com/r/amd64/mysql for valid versions.
     39# When using `mariadb`, see https://hub.docker.com/r/amd64/mariadb for valid versions.
    4040##
    4141LOCAL_DB_VERSION=5.7
  • branches/6.0/.github/workflows/coding-standards.yml

    r53595 r55482  
    2121      - '**.js'
    2222      - '**.php'
    23       # These files configure NPM. Changes could affect the outcome.
     23      # These files configure npm. Changes could affect the outcome.
    2424      - 'package*.json'
    2525      # These files configure Composer. Changes could affect the outcome.
     
    4848  # - Checks out the repository.
    4949  # - Sets up PHP.
    50   # - Logs debug information.
    5150  # - Configures caching for PHPCS scans.
    52   # - Installs Composer dependencies (use cache if possible).
     51  # - Installs Composer dependencies.
    5352  # - Make Composer packages available globally.
    54   # - Logs PHP_CodeSniffer debug information.
    5553  # - Runs PHPCS on the full codebase with warnings suppressed.
     54  # - Generate a report for displaying issues as pull request annotations.
    5655  # - Runs PHPCS on the `tests` directory without warnings suppressed.
     56  # - Generate a report for displaying `test` directory issues as pull request annotations.
    5757  # - Ensures version-controlled files are not modified or deleted.
    5858  phpcs:
     
    6464    steps:
    6565      - name: Checkout repository
    66         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     66        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    6767
    6868      - name: Set up PHP
    69         uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
     69        uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
    7070        with:
    7171          php-version: '7.4'
    7272          coverage: none
    73           tools: composer, cs2pr
    74 
    75       - name: Log debug information
    76         run: |
    77           php --version
    78           composer --version
     73          tools: cs2pr
    7974
    8075      # This date is used to ensure that the PHPCS cache is cleared at least once every week.
     
    8277      - name: "Get last Monday's date"
    8378        id: get-date
    84         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
     79        run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    8580
    8681      - name: Cache PHPCS scan cache
    87         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
    88         with:
    89           path: .cache/phpcs.json
     82        uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
     83        with:
     84          path: |
     85            .cache/phpcs-src.json
     86            .cache/phpcs-tests.json
    9087          key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
    9188
     89      # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
     90      # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    9291      - name: Install Composer dependencies
    93         uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
    94         with:
    95           composer-options: "--no-progress --no-ansi --no-interaction"
     92        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
     93        with:
     94          custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    9695
    9796      - name: Make Composer packages available globally
    9897        run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    9998
    100       - name: Log PHPCS debug information
    101         run: phpcs -i
    102 
    10399      - name: Run PHPCS on all Core files
    104         run: phpcs -q -n --report=checkstyle | cs2pr
     100        id: phpcs-core
     101        run: phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml
     102
     103      - name: Show PHPCS results in PR
     104        if: ${{ always() && steps.phpcs-core.outcome == 'failure' }}
     105        run: cs2pr ./.cache/phpcs-report.xml
    105106
    106107      - name: Check test suite files for warnings
    107         run: phpcs tests -q --report=checkstyle | cs2pr
     108        id: phpcs-tests
     109        run: phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml
     110
     111      - name: Show test suite scan results in PR
     112        if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }}
     113        run: cs2pr ./.cache/phpcs-tests-report.xml
    108114
    109115      - name: Ensure version-controlled files are not modified during the tests
     
    116122  # Performs the following steps:
    117123  # - Checks out the repository.
     124  # - Sets up Node.js.
    118125  # - Logs debug information about the GitHub Action runner.
    119   # - Installs NodeJS.
    120   # - Logs updated debug information.
    121   # _ Installs NPM dependencies.
     126  # - Installs npm dependencies.
    122127  # - Run the WordPress JSHint checks.
    123128  # - Ensures version-controlled files are not modified or deleted.
     
    132137    steps:
    133138      - name: Checkout repository
    134         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     139        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     140
     141      - name: Set up Node.js
     142        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
     143        with:
     144          node-version-file: '.nvmrc'
     145          cache: npm
    135146
    136147      - name: Log debug information
     
    141152          svn --version
    142153
    143       - name: Install NodeJS
    144         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    145         with:
    146           node-version-file: '.nvmrc'
    147           cache: npm
    148 
    149       - name: Log debug information
    150         run: |
    151           npm --version
    152           node --version
    153 
    154       - name: Install Dependencies
     154      - name: Install npm Dependencies
    155155        run: npm ci
    156156
     
    173173      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    174174      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     175
     176  failed-workflow:
     177    name: Failed workflow tasks
     178    runs-on: ubuntu-latest
     179    needs: [ phpcs, jshint, slack-notifications ]
     180    if: |
     181      always() &&
     182      github.repository == 'WordPress/wordpress-develop' &&
     183      github.event_name != 'pull_request' &&
     184      github.run_attempt < 2 &&
     185      (
     186        needs.phpcs.result == 'cancelled' || needs.phpcs.result == 'failure' ||
     187        needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure'
     188      )
     189
     190    steps:
     191      - name: Dispatch workflow run
     192        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     193        with:
     194          retries: 2
     195          retry-exempt-status-codes: 418
     196          script: |
     197            github.rest.actions.createWorkflowDispatch({
     198              owner: context.repo.owner,
     199              repo: context.repo.repo,
     200              workflow_id: 'failed-workflow.yml',
     201              ref: 'trunk',
     202              inputs: {
     203                run_id: '${{ github.run_id }}'
     204              }
     205            });
  • branches/6.0/.github/workflows/end-to-end-tests.yml

    r53595 r55482  
    3434  # - Sets environment variables.
    3535  # - Checks out the repository.
     36  # - Sets up Node.js.
    3637  # - Logs debug information about the GitHub Action runner.
    37   # - Installs NodeJS.
    38   # _ Installs NPM dependencies.
     38  # - Installs npm dependencies.
    3939  # - Builds WordPress to run from the `build` directory.
    4040  # - Starts the WordPress Docker container.
    41   # - Logs general debug information.
    4241  # - Logs the running Docker containers.
    4342  # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
     
    5857
    5958      - name: Checkout repository
    60         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     59        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     60
     61      - name: Set up Node.js
     62        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
     63        with:
     64          node-version-file: '.nvmrc'
     65          cache: npm
    6166
    6267      - name: Log debug information
     
    6772          git --version
    6873          svn --version
    69           php --version
    70           php -i
    7174          locale -a
    7275
    73       - name: Install NodeJS
    74         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    75         with:
    76           node-version-file: '.nvmrc'
    77           cache: npm
    78 
    79       - name: Install Dependencies
     76      - name: Install npm Dependencies
    8077        run: npm ci
    8178
     
    8683        run: |
    8784          npm run env:start
    88 
    89       - name: General debug information
    90         run: |
    91           npm --version
    92           node --version
    93           curl --version
    94           git --version
    95           svn --version
    9685
    9786      - name: Log running Docker containers
     
    129118      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    130119      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     120
     121  failed-workflow:
     122    name: Failed workflow tasks
     123    runs-on: ubuntu-latest
     124    needs: [ e2e-tests, slack-notifications ]
     125    if: |
     126      always() &&
     127      github.repository == 'WordPress/wordpress-develop' &&
     128      github.event_name != 'pull_request' &&
     129      github.run_attempt < 2 &&
     130      (
     131        needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure'
     132      )
     133
     134    steps:
     135      - name: Dispatch workflow run
     136        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     137        with:
     138          retries: 2
     139          retry-exempt-status-codes: 418
     140          script: |
     141            github.rest.actions.createWorkflowDispatch({
     142              owner: context.repo.owner,
     143              repo: context.repo.repo,
     144              workflow_id: 'failed-workflow.yml',
     145              ref: 'trunk',
     146              inputs: {
     147                run_id: '${{ github.run_id }}'
     148              }
     149            });
  • branches/6.0/.github/workflows/javascript-tests.yml

    r53595 r55482  
    1919      # Any change to a JavaScript file should run tests.
    2020      - '**.js'
    21       # These files configure NPM. Changes could affect the outcome.
     21      # These files configure npm. Changes could affect the outcome.
    2222      - 'package*.json'
    2323      # This file configures ESLint. Changes could affect the outcome.
     
    4343  # Performs the following steps:
    4444  # - Checks out the repository.
     45  # - Sets up Node.js.
    4546  # - Logs debug information about the GitHub Action runner.
    46   # - Installs NodeJS.
    47   # - Logs updated debug information.
    48   # _ Installs NPM dependencies.
     47  # - Installs npm dependencies.
    4948  # - Run the WordPress QUnit tests.
    5049  # - Ensures version-controlled files are not modified or deleted.
     
    5756    steps:
    5857      - name: Checkout repository
    59         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     58        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     59
     60      - name: Set up Node.js
     61        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
     62        with:
     63          node-version-file: '.nvmrc'
     64          cache: npm
    6065
    6166      - name: Log debug information
     
    6671          svn --version
    6772
    68       - name: Install NodeJS
    69         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    70         with:
    71           node-version-file: '.nvmrc'
    72           cache: npm
    73 
    74       - name: Log debug information
    75         run: |
    76           npm --version
    77           node --version
    78 
    79       - name: Install Dependencies
     73      - name: Install npm Dependencies
    8074        run: npm ci
    8175
     
    9892      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    9993      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     94
     95  failed-workflow:
     96    name: Failed workflow tasks
     97    runs-on: ubuntu-latest
     98    needs: [ test-js, slack-notifications ]
     99    if: |
     100      always() &&
     101      github.repository == 'WordPress/wordpress-develop' &&
     102      github.event_name != 'pull_request' &&
     103      github.run_attempt < 2 &&
     104      (
     105        needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
     106      )
     107
     108    steps:
     109      - name: Dispatch workflow run
     110        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     111        with:
     112          retries: 2
     113          retry-exempt-status-codes: 418
     114          script: |
     115            github.rest.actions.createWorkflowDispatch({
     116              owner: context.repo.owner,
     117              repo: context.repo.repo,
     118              workflow_id: 'failed-workflow.yml',
     119              ref: 'trunk',
     120              inputs: {
     121                run_id: '${{ github.run_id }}'
     122              }
     123            });
  • branches/6.0/.github/workflows/php-compatibility.yml

    r53595 r55482  
    4545  # - Logs debug information.
    4646  # - Configures caching for PHP compatibility scans.
    47   # - Installs Composer dependencies (use cache if possible).
     47  # - Installs Composer dependencies.
    4848  # - Make Composer packages available globally.
    49   # - Logs PHP_CodeSniffer debug information.
    5049  # - Runs the PHP compatibility tests.
     50  # - Generate a report for displaying issues as pull request annotations.
    5151  # - Ensures version-controlled files are not modified or deleted.
    5252  php-compatibility:
     
    5858    steps:
    5959      - name: Checkout repository
    60         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     60        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    6161
    6262      - name: Set up PHP
    63         uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
     63        uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
    6464        with:
    6565          php-version: '7.4'
    6666          coverage: none
    67           tools: composer, cs2pr
     67          tools: cs2pr
    6868
    6969      - name: Log debug information
    7070        run: |
    71           php --version
    7271          composer --version
    7372
     
    7675      - name: "Get last Monday's date"
    7776        id: get-date
    78         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
     77        run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    7978
    8079      - name: Cache PHP compatibility scan cache
    81         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
     80        uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
    8281        with:
    8382          path: .cache/phpcompat.json
    8483          key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
    8584
     85      # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
     86      # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    8687      - name: Install Composer dependencies
    87         uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
     88        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    8889        with:
    89           composer-options: "--no-progress --no-ansi --no-interaction"
     90          custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    9091
    9192      - name: Make Composer packages available globally
    9293        run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    9394
    94       - name: Log PHPCS debug information
    95         run: phpcs -i
     95      - name: Run PHP compatibility tests
     96        id: phpcs
     97        run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
    9698
    97       - name: Run PHP compatibility tests
    98         run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
     99      - name: Show PHPCompatibility results in PR
     100        if: ${{ always() && steps.phpcs.outcome == 'failure' }}
     101        run: cs2pr ./.cache/phpcs-compat-report.xml
    99102
    100103      - name: Ensure version-controlled files are not modified or deleted
     
    113116      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    114117      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     118
     119  failed-workflow:
     120    name: Failed workflow tasks
     121    runs-on: ubuntu-latest
     122    needs: [ php-compatibility, slack-notifications ]
     123    if: |
     124      always() &&
     125      github.repository == 'WordPress/wordpress-develop' &&
     126      github.event_name != 'pull_request' &&
     127      github.run_attempt < 2 &&
     128      (
     129        needs.php-compatibility.result == 'cancelled' || needs.php-compatibility.result == 'failure'
     130      )
     131
     132    steps:
     133      - name: Dispatch workflow run
     134        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     135        with:
     136          retries: 2
     137          retry-exempt-status-codes: 418
     138          script: |
     139            github.rest.actions.createWorkflowDispatch({
     140              owner: context.repo.owner,
     141              repo: context.repo.repo,
     142              workflow_id: 'failed-workflow.yml',
     143              ref: 'trunk',
     144              inputs: {
     145                run_id: '${{ github.run_id }}'
     146              }
     147            });
  • branches/6.0/.github/workflows/phpunit-tests.yml

    r53595 r55482  
    4040  # Performs the following steps:
    4141  # - Sets environment variables.
    42   # - Sets up the environment variables needed for testing with memcached (if desired).
    43   # - Installs NodeJS.
    44   # - Installs NPM dependencies
    45   # - Configures caching for Composer.
     42  # - Checks out the repository.
     43  # - Sets up Node.js.
     44  # - Sets up PHP.
    4645  # - Installs Composer dependencies.
     46  # - Installs npm dependencies
     47  # - Logs general debug information about the runner.
    4748  # - Logs Docker debug information (about the Docker installation within the runner).
    4849  # - Starts the WordPress Docker container.
    49   # - Starts the Memcached server after the Docker network has been created (if desired).
    50   # - Logs general debug information about the runner.
    5150  # - Logs the running Docker containers.
    52   # - Logs debug information from inside the WordPress Docker container.
    5351  # - Logs debug information about what's installed within the WordPress Docker containers.
    5452  # - Install WordPress within the Docker container.
     
    5654  # - Ensures version-controlled files are not modified or deleted.
    5755  # - Checks out the WordPress Test reporter repository.
    58   # - Reconnect the directory to the Git repository.
    5956  # - Submit the test results to the WordPress.org host test results.
    6057  test-php:
     
    111108
    112109      - name: Checkout repository
    113         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    114 
    115       - name: Install NodeJS
    116         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     110        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     111
     112      - name: Set up Node.js
     113        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    117114        with:
    118115          node-version-file: '.nvmrc'
    119116          cache: npm
    120117
    121       - name: Install Dependencies
     118      ##
     119      # This allows Composer dependencies to be installed using a single step.
     120      #
     121      # Since the tests are currently run within the Docker containers where the PHP version varies,
     122      # the same PHP version needs to be configured for the action runner machine so that the correct
     123      # dependency versions are installed and cached.
     124      ##
     125      - name: Set up PHP
     126        uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
     127        with:
     128          php-version: '${{ matrix.php }}'
     129          coverage: none
     130
     131      # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
     132      # passing a custom cache suffix ensures that the cache is flushed at least once per week.
     133      - name: Install Composer dependencies
     134        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
     135        with:
     136          custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
     137
     138      - name: Install npm dependencies
    122139        run: npm ci
    123 
    124       # This date is used to ensure that the Composer cache is refreshed at least once every week.
    125       # http://man7.org/linux/man-pages/man1/date.1.html
    126       - name: "Get last Monday's date"
    127         id: get-date
    128         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
    129 
    130       - name: Get Composer cache directory
    131         id: composer-cache
    132         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    133 
    134       - name: Cache Composer dependencies
    135         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
    136         env:
    137           cache-name: cache-composer-dependencies
    138         with:
    139           path: ${{ steps.composer-cache.outputs.dir }}
    140           key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }}
    141 
    142       - name: Install Composer dependencies
    143         run: |
    144           docker-compose run --rm php composer --version
    145 
    146           # Install using `composer update` as there is no `composer.lock` file.
    147           if [ ${{ env.LOCAL_PHP }} == '8.1-fpm' ]; then
    148             docker-compose run --rm php composer update --ignore-platform-reqs
    149           else
    150             docker-compose run --rm php composer update
    151           fi
    152 
    153       - name: Docker debug information
    154         run: |
    155           docker -v
    156           docker-compose -v
    157 
    158       - name: Start Docker environment
    159         run: |
    160           npm run env:start
    161 
    162       # The memcached server needs to start after the Docker network has been set up with `npm run env:start`.
    163       - name: Start the Memcached server.
    164         if: ${{ matrix.memcached }}
    165         run: |
    166           cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php
    167           docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached
    168140
    169141      - name: General debug information
     
    174146          git --version
    175147          svn --version
     148          composer --version
     149          locale -a
     150
     151      - name: Docker debug information
     152        run: |
     153          docker -v
     154          docker-compose -v
     155
     156      - name: Start Docker environment
     157        run: |
     158          npm run env:start
    176159
    177160      - name: Log running Docker containers
     
    232215      - name: Checkout the WordPress Test Reporter
    233216        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    234         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     217        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    235218        with:
    236219          repository: 'WordPress/phpunit-test-runner'
     
    255238      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    256239      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     240
     241  failed-workflow:
     242    name: Failed workflow tasks
     243    runs-on: ubuntu-latest
     244    needs: [ test-php, slack-notifications ]
     245    if: |
     246      always() &&
     247      github.repository == 'WordPress/wordpress-develop' &&
     248      github.event_name != 'pull_request' &&
     249      github.run_attempt < 2 &&
     250      (
     251        needs.test-php.result == 'cancelled' || needs.test-php.result == 'failure'
     252      )
     253
     254    steps:
     255      - name: Dispatch workflow run
     256        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     257        with:
     258          retries: 2
     259          retry-exempt-status-codes: 418
     260          script: |
     261            github.rest.actions.createWorkflowDispatch({
     262              owner: context.repo.owner,
     263              repo: context.repo.repo,
     264              workflow_id: 'failed-workflow.yml',
     265              ref: 'trunk',
     266              inputs: {
     267                run_id: '${{ github.run_id }}'
     268              }
     269            });
  • branches/6.0/.github/workflows/test-coverage.yml

    r53112 r55482  
    9090      - name: "Get last Monday's date"
    9191        id: get-date
    92         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
     92        run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    9393
    9494      - name: Get Composer cache directory
    9595        id: composer-cache
    96         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     96        run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
    9797
    9898      - name: Cache Composer dependencies
     
    101101          cache-name: cache-composer-dependencies
    102102        with:
    103           path: ${{ steps.composer-cache.outputs.dir }}
     103          path: ${{ steps.composer-cache.outputs.composer_dir }}
    104104          key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }}
    105105
     
    182182      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    183183      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     184
     185  failed-workflow:
     186    name: Failed workflow tasks
     187    runs-on: ubuntu-latest
     188    needs: [ test-coverage-report, slack-notifications ]
     189    if: |
     190      always() &&
     191      github.repository == 'WordPress/wordpress-develop' &&
     192      github.event_name != 'pull_request' &&
     193      github.run_attempt < 2 &&
     194      (
     195        needs.test-coverage-report.result == 'cancelled' || needs.test-coverage-report.result == 'failure'
     196      )
     197
     198    steps:
     199      - name: Dispatch workflow run
     200        uses: actions/github-script@d4560e157075e2d93aa3022b5b51a42a880f1f93 # v6.3.0
     201        with:
     202          retries: 2
     203          retry-exempt-status-codes: 418
     204          script: |
     205            github.rest.actions.createWorkflowDispatch({
     206              owner: context.repo.owner,
     207              repo: context.repo.repo,
     208              workflow_id: 'failed-workflow.yml',
     209              ref: 'trunk',
     210              inputs: {
     211                run_id: '${{ github.run_id }}'
     212              }
     213            });
  • branches/6.0/.github/workflows/test-npm.yml

    r53738 r55482  
    1 name: Test NPM
     1name: Test npm
    22
    33on:
     
    1616      - '[4-9].[0-9]'
    1717    paths:
    18       # These files configure NPM. Changes could affect the outcome.
     18      # These files configure npm. Changes could affect the outcome.
    1919      - 'package*.json'
    20       # JavaScript files are built using NPM.
     20      # JavaScript files are built using npm.
    2121      - '**.js'
    22       # CSS and SCSS files are built using NPM.
     22      # CSS and SCSS files are built using npm.
    2323      - '**.scss'
    2424      - '**.css'
     
    3838
    3939jobs:
    40   # Verifies that installing NPM dependencies and building WordPress works as expected.
     40  # Verifies that installing npm dependencies and building WordPress works as expected.
    4141  #
    4242  # Performs the following steps:
    4343  # - Checks out the repository.
     44  # - Sets up Node.js.
    4445  # - Logs debug information about the GitHub Action runner.
    45   # - Installs NodeJS.
    46   # _ Installs NPM dependencies.
     46  # - Installs npm dependencies.
    4747  # - Builds WordPress to run from the `build` directory.
    4848  # - Cleans up after building WordPress to the `build` directory.
     
    5252  # - Ensures version-controlled files are not modified or deleted.
    5353  test-npm:
    54     name: Test NPM on ${{ matrix.os }}
     54    name: Test npm on ${{ matrix.os }}
    5555    runs-on: ${{ matrix.os }}
    5656    timeout-minutes: 20
     
    6363    steps:
    6464      - name: Checkout repository
    65         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     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
    6672
    6773      - name: Log debug information
     
    7379          svn --version
    7480
    75       - name: Install NodeJS
    76         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     81      - name: Install npm Dependencies
     82        run: npm ci
     83
     84      - name: Build WordPress in /src
     85        run: npm run build:dev
     86
     87      - name: Clean after building in /src
     88        run: npm run grunt clean -- --dev
     89
     90      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     91        run: git diff --exit-code
     92
     93      - name: Build WordPress
     94        run: npm run build
     95
     96      - name: Clean after building
     97        run: npm run grunt clean
     98
     99      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     100        run: git diff --exit-code
     101
     102  # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
     103  #
     104  # This is separate from the job above in order to use stricter conditions about when to run.
     105  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
     106  #
     107  # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
     108  # currently no way to determine the OS being used on a given job.
     109  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
     110  #
     111  # Performs the following steps:
     112  # - Checks out the repository.
     113  # - Sets up Node.js.
     114  # - Logs debug information about the GitHub Action runner.
     115  # - Installs npm dependencies.
     116  # - Builds WordPress to run from the `build` directory.
     117  # - Cleans up after building WordPress to the `build` directory.
     118  # - Ensures version-controlled files are not modified or deleted.
     119  # - Builds WordPress to run from the `src` directory.
     120  # - Cleans up after building WordPress to the `src` directory.
     121  # - Ensures version-controlled files are not modified or deleted.
     122  test-npm-macos:
     123    name: Test npm on MacOS
     124    runs-on: macos-latest
     125    timeout-minutes: 30
     126    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
     127    steps:
     128      - name: Checkout repository
     129        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     130
     131      - name: Set up Node.js
     132        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    77133        with:
    78134          node-version-file: '.nvmrc'
    79135          cache: npm
    80 
    81       - name: Install Dependencies
    82         run: npm ci
    83 
    84       - name: Build WordPress
    85         run: npm run build
    86 
    87       - name: Clean after building
    88         run: npm run grunt clean
    89 
    90       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    91         run: git diff --exit-code
    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   # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.
    103   #
    104   # This is separate from the job above in order to use stricter conditions about when to run.
    105   # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    106   #
    107   # Performs the following steps:
    108   # - Checks out the repository.
    109   # - Logs debug information about the GitHub Action runner.
    110   # - Installs NodeJS.
    111   # _ Installs NPM dependencies.
    112   # - Builds WordPress to run from the `build` directory.
    113   # - Cleans up after building WordPress to the `build` directory.
    114   # - Ensures version-controlled files are not modified or deleted.
    115   # - Builds WordPress to run from the `src` directory.
    116   # - Cleans up after building WordPress to the `src` directory.
    117   # - Ensures version-controlled files are not modified or deleted.
    118   test-npm-macos:
    119     name: Test NPM on MacOS
    120     runs-on: macos-latest
    121     timeout-minutes: 20
    122     if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    123     steps:
    124       - name: Checkout repository
    125         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    126136
    127137      - name: Log debug information
     
    133143          svn --version
    134144
    135       - name: Install NodeJS
    136         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    137         with:
    138           node-version-file: '.nvmrc'
    139           cache: npm
    140 
    141       - name: Install Dependencies
     145      - name: Install npm Dependencies
    142146        run: npm ci
     147
     148      - name: Build WordPress in /src
     149        run: npm run build:dev
     150
     151      - name: Clean after building in /src
     152        run: npm run grunt clean -- --dev
     153
     154      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     155        run: git diff --exit-code
    143156
    144157      - name: Build WordPress
     
    147160      - name: Clean after building
    148161        run: npm run grunt clean
    149 
    150       - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    151         run: git diff --exit-code
    152 
    153       - name: Build WordPress in /src
    154         run: npm run build:dev
    155 
    156       - name: Clean after building in /src
    157         run: npm run grunt clean -- --dev
    158162
    159163      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
     
    172176      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    173177      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     178
     179  failed-workflow:
     180    name: Failed workflow tasks
     181    runs-on: ubuntu-latest
     182    needs: [ test-npm, test-npm-macos, slack-notifications ]
     183    if: |
     184      always() &&
     185      github.repository == 'WordPress/wordpress-develop' &&
     186      github.event_name != 'pull_request' &&
     187      github.run_attempt < 2 &&
     188      (
     189        needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
     190        needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     191      )
     192
     193    steps:
     194      - name: Dispatch workflow run
     195        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     196        with:
     197          retries: 2
     198          retry-exempt-status-codes: 418
     199          script: |
     200            github.rest.actions.createWorkflowDispatch({
     201              owner: context.repo.owner,
     202              repo: context.repo.repo,
     203              workflow_id: 'failed-workflow.yml',
     204              ref: 'trunk',
     205              inputs: {
     206                run_id: '${{ github.run_id }}'
     207              }
     208            });
  • branches/6.0/.github/workflows/welcome-new-contributors.yml

    r52233 r55482  
    1313
    1414    steps:
    15       - uses: bubkoo/welcome-action@8dbbac2540d155744c90e4e37da6b05ffc9c5e2c # v1.0.3
     15      - uses: bubkoo/welcome-action@e3f444df06502502071d309411d01ba18f916ede # v1.0.3
    1616        with:
    1717          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  • branches/6.0/docker-compose.yml

    r53350 r55482  
    4949      - ./:/var/www
    5050
     51    # Copy or delete the Memcached dropin plugin file as appropriate.
     52    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"
     53
    5154    depends_on:
    5255      - mysql
     56
     57    # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly.
     58    init: true
     59
     60    extra_hosts:
     61      - localhost:host-gateway
    5362
    5463  ##
     
    5665  ##
    5766  mysql:
    58     image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest}
     67    image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest}
    5968
    6069    networks:
     
    95104    init: true
    96105
     106    extra_hosts:
     107      - localhost:host-gateway
     108
     109  ##
     110  # The Memcached container.
     111  ##
     112  memcached:
     113    image: memcached
     114
     115    networks:
     116      - wpdevnet
     117
     118    ports:
     119      - 11211:11211
     120
    97121volumes:
    98122  # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
  • branches/6.0/tools/local-env/scripts/docker.js

    r53359 r55482  
    55dotenvExpand.expand( dotenv.config() );
    66
    7 if ( process.arch === 'arm64' ) {
    8     process.env.LOCAL_DB_TYPE = `amd64/${process.env.LOCAL_DB_TYPE}`;
    9 }
    10 
    117// Execute any docker-compose command passed to this script.
    128execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
  • branches/6.0/tools/local-env/scripts/install.js

    r53359 r55482  
    66
    77dotenvExpand.expand( dotenv.config() );
    8 
    9 if ( process.arch === 'arm64' ) {
    10     process.env.LOCAL_DB_TYPE = `amd64/${process.env.LOCAL_DB_TYPE}`;
    11 }
    128
    139// Create wp-config.php.
  • branches/6.0/tools/local-env/scripts/start.js

    r53359 r55482  
    55dotenvExpand.expand( dotenv.config() );
    66
    7 if ( process.arch === 'arm64' ) {
    8     process.env.LOCAL_DB_TYPE = `amd64/${process.env.LOCAL_DB_TYPE}`;
    9 }
    10 
    117// Start the local-env containers.
    12 execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } );
     8const containers = ( process.env.LOCAL_PHP_MEMCACHED === 'true' )
     9    ? 'wordpress-develop memcached'
     10    : 'wordpress-develop';
     11execSync( `docker-compose up -d -- ${containers}`, { stdio: 'inherit' } );
    1312
    1413// 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.