Make WordPress Core


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:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • 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            });
Note: See TracChangeset for help on using the changeset viewer.