Make WordPress Core


Ignore:
Timestamp:
03/10/2023 04:29:55 PM (12 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], [54650], [54651], [54674], [54750], [54852], [55152], [54651], [55487] to the 4.5 branch.
See #55652, #56407, #56528, #54695, #56820, #56816, #56793, #56820, #57572.

Location:
branches/4.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

  • branches/4.5/.github/workflows/test-npm.yml

    r53616 r55531  
    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:
     
    4144  # - Logs debug information about the GitHub Action runner.
    4245  # - Installs NodeJS.
    43   # _ Installs NPM dependencies.
     46  # _ Installs npm dependencies.
    4447  # - Builds WordPress to run from the `build` directory.
    4548  # - Cleans up after building WordPress to the `build` directory.
    4649  test-npm:
    47     name: Test NPM on ${{ matrix.os }}
     50    name: Test npm on ${{ matrix.os }}
    4851    runs-on: ${{ matrix.os }}
    4952    timeout-minutes: 20
     
    5659    steps:
    5760      - name: Checkout repository
    58         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     61        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    5962
    6063      - name: Log debug information
     
    6669          svn --version
    6770
    68       - name: Install NodeJS
    69         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     71      - name: Set up Node.js
     72        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    7073        with:
    7174          node-version-file: '.nvmrc'
     
    8184        run: npm run grunt clean
    8285
    83   # Verifies that installing NPM dependencies and building WordPress works as expected on MacOS.
     86  # Verifies that installing npm dependencies and building WordPress works as expected on MacOS.
    8487  #
    8588  # This is separate from the job above in order to use stricter conditions about when to run.
    8689  # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate.
     90  #
     91  # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is
     92  # currently no way to determine the OS being used on a given job.
     93  # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability.
    8794  #
    8895  # Performs the following steps:
     
    9097  # - Logs debug information about the GitHub Action runner.
    9198  # - Installs NodeJS.
    92   # _ Installs NPM dependencies.
     99  # _ Installs npm dependencies.
    93100  # - Builds WordPress to run from the `build` directory.
    94101  # - Cleans up after building WordPress to the `build` directory.
    95102  test-npm-macos:
    96     name: Test NPM on MacOS
     103    name: Test npm on MacOS
    97104    runs-on: macos-latest
     105    timeout-minutes: 30
    98106    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    99107    steps:
    100108      - name: Checkout repository
    101         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     109        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    102110
    103111      - name: Log debug information
     
    109117          svn --version
    110118
    111       - name: Install NodeJS
    112         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     119      - name: Set up Node.js
     120        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    113121        with:
    114122          node-version-file: '.nvmrc'
     
    136144      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    137145      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     146
     147  failed-workflow:
     148    name: Failed workflow tasks
     149    runs-on: ubuntu-latest
     150    needs: [ test-npm, test-npm-macos, slack-notifications ]
     151    if: |
     152      always() &&
     153      github.repository == 'WordPress/wordpress-develop' &&
     154      github.event_name != 'pull_request' &&
     155      github.run_attempt < 2 &&
     156      (
     157        needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure' ||
     158        needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'
     159      )
     160
     161    steps:
     162      - name: Dispatch workflow run
     163        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     164        with:
     165          retries: 2
     166          retry-exempt-status-codes: 418
     167          script: |
     168            github.rest.actions.createWorkflowDispatch({
     169              owner: context.repo.owner,
     170              repo: context.repo.repo,
     171              workflow_id: 'failed-workflow.yml',
     172              ref: 'trunk',
     173              inputs: {
     174                run_id: '${{ github.run_id }}'
     175              }
     176            });
Note: See TracChangeset for help on using the changeset viewer.