Make WordPress Core


Ignore:
Timestamp:
03/10/2023 04:07:11 PM (3 years 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.8 branch.
See #55652, #56407, #56528, #54695, #56820, #56816, #56793, #56820, #57572.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/.github/workflows/phpunit-tests.yml

    r53597 r55517  
    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   # - Sets up caching for NPM.
    44   # - Installs NPM dependencies
     42  # - Installs Node.js.
     43  # - Installs npm dependencies
    4544  # - Configures caching for Composer.
    4645  # - Installs Composer dependencies.
     
    110109
    111110      - name: Checkout repository
    112         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    113 
    114       - name: Install NodeJS
    115         uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
     111        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
     112
     113      - name: Install Node.js
     114        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
    116115        with:
    117116          node-version-file: '.nvmrc'
    118117          cache: npm
    119118
    120       - name: Install Dependencies
     119      - name: Install npm dependencies
    121120        run: npm ci
    122121
    123122      - name: Get composer cache directory
    124123        id: composer-cache
    125         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     124        run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
    126125
    127126      - name: Cache Composer dependencies
    128         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
     127        uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
    129128        env:
    130129          cache-name: cache-composer-dependencies
    131130        with:
    132           path: ${{ steps.composer-cache.outputs.dir }}
     131          path: ${{ steps.composer-cache.outputs.composer_dir }}
    133132          key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
    134133
     
    229228      - name: Checkout the WordPress Test Reporter
    230229        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }}
    231         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     230        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    232231        with:
    233232          repository: 'WordPress/phpunit-test-runner'
     
    252251      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    253252      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     253
     254  failed-workflow:
     255    name: Failed workflow tasks
     256    runs-on: ubuntu-latest
     257    needs: [ test-php, slack-notifications ]
     258    if: |
     259      always() &&
     260      github.repository == 'WordPress/wordpress-develop' &&
     261      github.event_name != 'pull_request' &&
     262      github.run_attempt < 2 &&
     263      (
     264        needs.test-php.result == 'cancelled' || needs.test-php.result == 'failure'
     265      )
     266
     267    steps:
     268      - name: Dispatch workflow run
     269        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     270        with:
     271          retries: 2
     272          retry-exempt-status-codes: 418
     273          script: |
     274            github.rest.actions.createWorkflowDispatch({
     275              owner: context.repo.owner,
     276              repo: context.repo.repo,
     277              workflow_id: 'failed-workflow.yml',
     278              ref: 'trunk',
     279              inputs: {
     280                run_id: '${{ github.run_id }}'
     281              }
     282            });
Note: See TracChangeset for help on using the changeset viewer.