Make WordPress Core

Changeset 55523 for branches/5.2


Ignore:
Timestamp:
03/10/2023 04:10:01 PM (21 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.
  • removes workflow files that are not applicable to the branch.
  • backports some Docker environment related tooling updates for the sake of consistency across branches.

Merges [53736], [53737], [53940], [53947], [54039], [54096], [54108], [54293], [54313], [54342], [54343], [54373], [54511], [54649], [54650], [54651], [54674], [54750], [54852], [55152], [55487] to the 5.2 branch.
See #55652, #56407, #56528, #54695, #56820, #56816, #56793, #56820, #57572.

Location:
branches/5.2
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/.env

    r50305 r55523  
    5858# Defaults to 5.7 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
    5959#
    60 # When using `mysql`, see https://hub.docker.com/_/mysql/ for valid versions.
    61 # When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
     60# When using `mysql`, see https://hub.docker.com/r/amd64/mysql for valid versions.
     61# When using `mariadb`, see https://hub.docker.com/r/amd64/mariadb for valid versions.
    6262##
    6363LOCAL_DB_VERSION=5.7
  • branches/5.2/.github/workflows/coding-standards.yml

    r53603 r55523  
    1010      - '[4-9].[0-9]'
    1111    tags:
    12       - '3.[89]*'
    13       - '[4-9].[0-9]*'
     12      - '[0-9]+.[0-9]'
     13      - '[0-9]+.[0-9].[0-9]+'
     14      - '!3.7.[0-9]+'
    1415  pull_request:
    1516    branches:
     
    2122      - '**.js'
    2223      - '**.php'
    23       # These files configure NPM. Changes could affect the outcome.
     24      # These files configure npm. Changes could affect the outcome.
    2425      - 'package*.json'
    2526      # These files configure Composer. Changes could affect the outcome.
     
    6263    steps:
    6364      - name: Checkout repository
    64         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     65        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    6566
    6667      - name: Set up PHP
    67         uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
     68        uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
    6869        with:
    6970          php-version: '7.3'
     
    7778
    7879      - name: Install Composer dependencies
    79         uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
     80        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    8081        with:
    81           composer-options: "--no-progress --no-ansi --no-interaction"
     82          composer-options: "--no-progress --no-ansi"
    8283
    8384      - name: Make Composer packages available globally
     
    9798  # - Checks out the repository.
    9899  # - Logs debug information about the GitHub Action runner.
    99   # - Installs NodeJS.
     100  # - Installs Node.js.
    100101  # - Logs updated debug information.
    101   # _ Installs NPM dependencies.
     102  # _ Installs npm dependencies.
    102103  # - Run the WordPress JSHint checks.
    103104  jshint:
     
    111112    steps:
    112113      - name: Checkout repository
    113         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     114        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    114115
    115116      - name: Log debug information
     
    120121          svn --version
    121122
    122       - name: Install NodeJS
    123         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     123      - name: Install Node.js
     124        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    124125        with:
    125126          node-version-file: '.nvmrc'
     
    149150      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    150151      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     152
     153  failed-workflow:
     154    name: Failed workflow tasks
     155    runs-on: ubuntu-latest
     156    needs: [ phpcs, jshint, slack-notifications ]
     157    if: |
     158      always() &&
     159      github.repository == 'WordPress/wordpress-develop' &&
     160      github.event_name != 'pull_request' &&
     161      github.run_attempt < 2 &&
     162      (
     163        needs.phpcs.result == 'cancelled' || needs.phpcs.result == 'failure' ||
     164        needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure'
     165      )
     166
     167    steps:
     168      - name: Dispatch workflow run
     169        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     170        with:
     171          retries: 2
     172          retry-exempt-status-codes: 418
     173          script: |
     174            github.rest.actions.createWorkflowDispatch({
     175              owner: context.repo.owner,
     176              repo: context.repo.repo,
     177              workflow_id: 'failed-workflow.yml',
     178              ref: 'trunk',
     179              inputs: {
     180                run_id: '${{ github.run_id }}'
     181              }
     182            });
  • branches/5.2/.github/workflows/javascript-tests.yml

    r53603 r55523  
    99      - '[4-9].[0-9]'
    1010    tags:
    11       - '3.[89]*'
    12       - '[4-9].[0-9]*'
     11      - '[0-9]+.[0-9]'
     12      - '[0-9]+.[0-9].[0-9]+'
     13      - '!3.7.[0-9]+'
    1314  pull_request:
    1415    branches:
     
    1920      # Any change to a JavaScript file should run tests.
    2021      - '**.js'
    21       # These files configure NPM. Changes could affect the outcome.
     22      # These files configure npm. Changes could affect the outcome.
    2223      - 'package*.json'
    2324      # This file configures ESLint. Changes could affect the outcome.
     
    4445  # - Checks out the repository.
    4546  # - Logs debug information about the GitHub Action runner.
    46   # - Installs NodeJS.
     47  # - Installs Node.js.
    4748  # - Logs updated debug information.
    48   # _ Installs NPM dependencies.
     49  # _ Installs npm dependencies.
    4950  # - Run the WordPress QUnit tests.
    5051  test-js:
     
    5657    steps:
    5758      - name: Checkout repository
    58         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     59        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    5960
    6061      - name: Log debug information
     
    6566          svn --version
    6667
    67       - name: Install NodeJS
    68         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     68      - name: Set up Node.js
     69        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    6970        with:
    7071          node-version-file: '.nvmrc'
     
    9495      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    9596      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     97
     98  failed-workflow:
     99    name: Failed workflow tasks
     100    runs-on: ubuntu-latest
     101    needs: [ test-js, slack-notifications ]
     102    if: |
     103      always() &&
     104      github.repository == 'WordPress/wordpress-develop' &&
     105      github.event_name != 'pull_request' &&
     106      github.run_attempt < 2 &&
     107      (
     108        needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
     109      )
     110
     111    steps:
     112      - name: Dispatch workflow run
     113        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     114        with:
     115          retries: 2
     116          retry-exempt-status-codes: 418
     117          script: |
     118            github.rest.actions.createWorkflowDispatch({
     119              owner: context.repo.owner,
     120              repo: context.repo.repo,
     121              workflow_id: 'failed-workflow.yml',
     122              ref: 'trunk',
     123              inputs: {
     124                run_id: '${{ github.run_id }}'
     125              }
     126            });
  • branches/5.2/.github/workflows/phpunit-tests.yml

    r53603 r55523  
    88      - '[4-9].[0-9]'
    99    tags:
    10       - '3.[7-9]*'
    11       - '[4-9].[0-9]*'
     10      - '[0-9]+.[0-9]'
     11      - '[0-9]+.[0-9].[0-9]+'
    1212  pull_request:
    1313    branches:
     
    2929env:
    3030  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    31   # Controls which NPM script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
     31  # Controls which npm script to use for running PHPUnit tests. Options ar `php` and `php-composer`.
    3232  PHPUNIT_SCRIPT: php
    3333  LOCAL_PHP_MEMCACHED: ${{ false }}
     
    4040  # - Sets environment variables.
    4141  # - Sets up the environment variables needed for testing with memcached (if desired).
    42   # - Installs NodeJS.
    43   # - Installs NPM dependencies
     42  # - Installs Node.js.
     43  # - Installs npm dependencies
    4444  # - Configures caching for Composer.
    4545  # - Installs Composer dependencies.
     
    107107
    108108      - name: Checkout repository
    109         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    110 
    111       - name: Install NodeJS
    112         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     109        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     110
     111      - name: Install Node.js
     112        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    113113        with:
    114114          node-version-file: '.nvmrc'
    115115          cache: npm
    116116
    117       - name: Install Dependencies
     117
     118      - name: Install npm dependencies
    118119        run: npm ci
    119120
    120       - name: Get composer cache directory
     121      - name: Get Composer cache directory
    121122        id: composer-cache
    122         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     123        run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
    123124
    124125      - name: Cache Composer dependencies
    125         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
     126        uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
    126127        env:
    127128          cache-name: cache-composer-dependencies
    128129        with:
    129           path: ${{ steps.composer-cache.outputs.dir }}
     130          path: ${{ steps.composer-cache.outputs.composer_dir }}
    130131          key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
    131132
     
    213214      - name: Checkout the WordPress Test Reporter
    214215        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    215         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     216        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    216217        with:
    217218          repository: 'WordPress/phpunit-test-runner'
     
    236237      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    237238      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     239
     240  failed-workflow:
     241    name: Failed workflow tasks
     242    runs-on: ubuntu-latest
     243    needs: [ test-php, slack-notifications ]
     244    if: |
     245      always() &&
     246      github.repository == 'WordPress/wordpress-develop' &&
     247      github.event_name != 'pull_request' &&
     248      github.run_attempt < 2 &&
     249      (
     250        needs.test-php.result == 'cancelled' || needs.test-php.result == 'failure'
     251      )
     252
     253    steps:
     254      - name: Dispatch workflow run
     255        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     256        with:
     257          retries: 2
     258          retry-exempt-status-codes: 418
     259          script: |
     260            github.rest.actions.createWorkflowDispatch({
     261              owner: context.repo.owner,
     262              repo: context.repo.repo,
     263              workflow_id: 'failed-workflow.yml',
     264              ref: 'trunk',
     265              inputs: {
     266                run_id: '${{ github.run_id }}'
     267              }
     268            });
  • branches/5.2/.github/workflows/test-npm.yml

    r53603 r55523  
    1 name: Test NPM
     1name: Test npm
    22
    33on:
     
    77      - '3.[7-9]'
    88      - '[4-9].[0-9]'
     9    tags:
     10      - '[0-9]+.[0-9]'
     11      - '[0-9]+.[0-9].[0-9]+'
    912  pull_request:
    1013    branches:
     
    1316      - '[4-9].[0-9]'
    1417    paths:
    15       # These files configure NPM. Changes could affect the outcome.
     18      # These files configure npm. Changes could affect the outcome.
    1619      - 'package*.json'
    17       # JavaScript files are built using NPM.
     20      # JavaScript files are built using npm.
    1821      - '**.js'
    19       # CSS and SCSS files are built using NPM.
     22      # CSS and SCSS files are built using npm.
    2023      - '**.scss'
    2124      - '**.css'
     
    3538
    3639jobs:
    37   # Verifies that installing NPM dependencies and building WordPress works as expected.
     40  # Verifies that installing npm dependencies and building WordPress works as expected.
    3841  #
    3942  # Performs the following steps:
    4043  # - Checks out the repository.
    4144  # - Logs debug information about the GitHub Action runner.
    42   # - Installs NodeJS.
    43   # _ Installs NPM dependencies.
     45  # - Installs Node.js.
     46  # _ Installs npm dependencies.
    4447  # - Builds WordPress to run from the `build` directory.
    4548  # - Cleans up after building WordPress to the `build` directory.
     
    4750  # - Cleans up after building WordPress to the `src` directory.
    4851  test-npm:
    49     name: Test NPM on ${{ matrix.os }}
     52    name: Test npm on ${{ matrix.os }}
    5053    runs-on: ${{ matrix.os }}
    5154    timeout-minutes: 20
     
    5861    steps:
    5962      - name: Checkout repository
    60         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     63        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    6164
    6265      - name: Log debug information
     
    6871          svn --version
    6972
    70       - name: Install NodeJS
    71         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     73      - name: Install Node.js
     74        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    7275        with:
    7376          node-version-file: '.nvmrc'
     
    8992        run: npm run grunt clean -- --dev
    9093
    91   # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.
     94  # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
    9295  #
    9396  # This is separate from the job above in order to use stricter conditions about when to run.
    9497  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
    9598  #
     99  # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
     100  # currently no way to determine the OS being used on a given job.
     101  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
     102  #
    96103  # Performs the following steps:
    97104  # - Checks out the repository.
    98105  # - Logs debug information about the GitHub Action runner.
    99   # - Installs NodeJS.
    100   # _ Installs NPM dependencies.
     106  # - Installs Node.js.
     107  # _ Installs npm dependencies.
    101108  # - Builds WordPress to run from the `build` directory.
    102109  # - Cleans up after building WordPress to the `build` directory.
     
    104111  # - Cleans up after building WordPress to the `src` directory.
    105112  test-npm-macos:
    106     name: Test NPM on MacOS
     113    name: Test npm on MacOS
    107114    runs-on: macos-latest
    108     timeout-minutes: 20
     115    timeout-minutes: 30
    109116    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    110117    steps:
    111118      - name: Checkout repository
    112         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     119        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    113120
    114121      - name: Log debug information
     
    120127          svn --version
    121128
    122       - name: Install NodeJS
    123         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     129      - name: Install Node.js
     130        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    124131        with:
    125132          node-version-file: '.nvmrc'
     
    153160      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    154161      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     162
     163  failed-workflow:
     164    name: Failed workflow tasks
     165    runs-on: ubuntu-latest
     166    needs: [ test-npm, test-npm-macos, slack-notifications ]
     167    if: |
     168      always() &&
     169      github.repository == 'WordPress/wordpress-develop' &&
     170      github.event_name != 'pull_request' &&
     171      github.run_attempt < 2 &&
     172      (
     173        needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
     174        needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     175      )
     176
     177    steps:
     178      - name: Dispatch workflow run
     179        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     180        with:
     181          retries: 2
     182          retry-exempt-status-codes: 418
     183          script: |
     184            github.rest.actions.createWorkflowDispatch({
     185              owner: context.repo.owner,
     186              repo: context.repo.repo,
     187              workflow_id: 'failed-workflow.yml',
     188              ref: 'trunk',
     189              inputs: {
     190                run_id: '${{ github.run_id }}'
     191              }
     192            });
  • branches/5.2/.github/workflows/welcome-new-contributors.yml

    r53603 r55523  
    1313
    1414    steps:
    15       - uses: bubkoo/welcome-action@8dbbac2540d155744c90e4e37da6b05ffc9c5e2c # v1.0.3
     15      - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0
    1616        with:
    17           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    1817          FIRST_PR_COMMENT: >
    1918            Hi @{{ author }}! 👋
  • branches/5.2/docker-compose.yml

    r50305 r55523  
    5454  ##
    5555  mysql:
    56     image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-5.7}
     56    image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-5.7}
    5757
    5858    networks:
Note: See TracChangeset for help on using the changeset viewer.