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/phpunit-tests.yml

    r53596 r55516  
    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:
     
    4141  # - Sets environment variables.
    4242  # - Sets up the environment variables needed for testing with memcached (if desired).
    43   # - Installs NodeJS.
    44   # - Installs NPM dependencies
     43  # - Installs Node.js.
     44  # - Installs npm dependencies
    4545  # - Configures caching for Composer.
    4646  # - Installs Composer dependencies.
     
    111111
    112112      - 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
     113        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     114
     115      - name: Install Node.js
     116        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    117117        with:
    118118          node-version-file: '.nvmrc'
    119119          cache: npm
    120120
    121       - name: Install Dependencies
     121      - name: Install npm dependencies
    122122        run: npm ci
    123123
     
    126126      - name: "Get last Monday's date"
    127127        id: get-date
    128         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
     128        run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    129129
    130130      - name: Get Composer cache directory
    131131        id: composer-cache
    132         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     132        run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
    133133
    134134      - name: Cache Composer dependencies
    135         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
     135        uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
    136136        env:
    137137          cache-name: cache-composer-dependencies
    138138        with:
    139           path: ${{ steps.composer-cache.outputs.dir }}
     139          path: ${{ steps.composer-cache.outputs.composer_dir }}
    140140          key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }}
    141141
     
    232232      - name: Checkout the WordPress Test Reporter
    233233        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    234         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     234        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    235235        with:
    236236          repository: 'WordPress/phpunit-test-runner'
     
    255255      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    256256      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     257
     258  failed-workflow:
     259    name: Failed workflow tasks
     260    runs-on: ubuntu-latest
     261    needs: [ test-php, slack-notifications ]
     262    if: |
     263      always() &&
     264      github.repository == 'WordPress/wordpress-develop' &&
     265      github.event_name != 'pull_request' &&
     266      github.run_attempt < 2 &&
     267      (
     268        needs.test-php.result == 'cancelled' || needs.test-php.result == 'failure'
     269      )
     270
     271    steps:
     272      - name: Dispatch workflow run
     273        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     274        with:
     275          retries: 2
     276          retry-exempt-status-codes: 418
     277          script: |
     278            github.rest.actions.createWorkflowDispatch({
     279              owner: context.repo.owner,
     280              repo: context.repo.repo,
     281              workflow_id: 'failed-workflow.yml',
     282              ref: 'trunk',
     283              inputs: {
     284                run_id: '${{ github.run_id }}'
     285              }
     286            });
Note: See TracChangeset for help on using the changeset viewer.