Make WordPress Core


Ignore:
Timestamp:
03/10/2023 03:52:41 PM (15 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.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9/.github/workflows/coding-standards.yml

    r53596 r55516  
    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.
     
    6465    steps:
    6566      - name: Checkout repository
    66         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     67        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    6768
    6869      - name: Set up PHP
    69         uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
     70        uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
    7071        with:
    7172          php-version: '7.4'
     
    8283      - name: "Get last Monday's date"
    8384        id: get-date
    84         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
     85        run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    8586
    8687      - name: Cache PHPCS scan cache
    87         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
     88        uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
    8889        with:
    8990          path: .cache/phpcs.json
     
    9192
    9293      - name: Install Composer dependencies
    93         uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
    94         with:
    95           composer-options: "--no-progress --no-ansi --no-interaction"
     94        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
     95        with:
     96          composer-options: "--no-progress --no-ansi"
    9697
    9798      - name: Make Composer packages available globally
     
    117118  # - Checks out the repository.
    118119  # - Logs debug information about the GitHub Action runner.
    119   # - Installs NodeJS.
     120  # - Installs Node.js.
    120121  # - Logs updated debug information.
    121   # _ Installs NPM dependencies.
     122  # _ Installs npm dependencies.
    122123  # - Run the WordPress JSHint checks.
    123124  # - Ensures version-controlled files are not modified or deleted.
     
    132133    steps:
    133134      - name: Checkout repository
    134         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     135        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    135136
    136137      - name: Log debug information
     
    141142          svn --version
    142143
    143       - name: Install NodeJS
    144         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     144      - name: Install Node.js
     145        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    145146        with:
    146147          node-version-file: '.nvmrc'
     
    173174      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    174175      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     176
     177  failed-workflow:
     178    name: Failed workflow tasks
     179    runs-on: ubuntu-latest
     180    needs: [ phpcs, jshint, slack-notifications ]
     181    if: |
     182      always() &&
     183      github.repository == 'WordPress/wordpress-develop' &&
     184      github.event_name != 'pull_request' &&
     185      github.run_attempt < 2 &&
     186      (
     187        needs.phpcs.result == 'cancelled' || needs.phpcs.result == 'failure' ||
     188        needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure'
     189      )
     190
     191    steps:
     192      - name: Dispatch workflow run
     193        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     194        with:
     195          retries: 2
     196          retry-exempt-status-codes: 418
     197          script: |
     198            github.rest.actions.createWorkflowDispatch({
     199              owner: context.repo.owner,
     200              repo: context.repo.repo,
     201              workflow_id: 'failed-workflow.yml',
     202              ref: 'trunk',
     203              inputs: {
     204                run_id: '${{ github.run_id }}'
     205              }
     206            });
Note: See TracChangeset for help on using the changeset viewer.