Make WordPress Core


Ignore:
Timestamp:
03/07/2023 07:36:29 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.
  • backports some Docker environment related tooling updates for the sake of consistency across branches.

Merges [53628], [53636], [53736], [53737], [53895], [53940], [53947], [54039], [54096], [54108], [54293], [54297], [54313], [54342], [54343], [54371], [54373], [54511], [54649], [54650], [54674], [54678], [54750], [54851], [54852], [54856], [54921], [55152] to the 6.0 branch.
See 55702, #52708, #55652, #55652, #55700, #55652, #56407, #56407, #56528, #55652, #55652, #55652, #54695, #55652, #55652, #55652, #55652, #56820, #56820, #56816, #55652, #55652, #56820, #56793, #56793, #53841, #57148, #57572, #56682.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0/.github/workflows/php-compatibility.yml

    r53595 r55482  
    4545  # - Logs debug information.
    4646  # - Configures caching for PHP compatibility scans.
    47   # - Installs Composer dependencies (use cache if possible).
     47  # - Installs Composer dependencies.
    4848  # - Make Composer packages available globally.
    49   # - Logs PHP_CodeSniffer debug information.
    5049  # - Runs the PHP compatibility tests.
     50  # - Generate a report for displaying issues as pull request annotations.
    5151  # - Ensures version-controlled files are not modified or deleted.
    5252  php-compatibility:
     
    5858    steps:
    5959      - name: Checkout repository
    60         uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
     60        uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
    6161
    6262      - name: Set up PHP
    63         uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
     63        uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc # v2.23.0
    6464        with:
    6565          php-version: '7.4'
    6666          coverage: none
    67           tools: composer, cs2pr
     67          tools: cs2pr
    6868
    6969      - name: Log debug information
    7070        run: |
    71           php --version
    7271          composer --version
    7372
     
    7675      - name: "Get last Monday's date"
    7776        id: get-date
    78         run: echo "::set-output name=date::$(/bin/date -u --date='last Mon' "+%F")"
     77        run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
    7978
    8079      - name: Cache PHP compatibility scan cache
    81         uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
     80        uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3
    8281        with:
    8382          path: .cache/phpcompat.json
    8483          key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
    8584
     85      # Since Composer dependencies are installed using `composer update` and no lock file is in version control,
     86      # passing a custom cache suffix ensures that the cache is flushed at least once per week.
    8687      - name: Install Composer dependencies
    87         uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
     88        uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
    8889        with:
    89           composer-options: "--no-progress --no-ansi --no-interaction"
     90          custom-cache-suffix: ${{ steps.get-date.outputs.date }}
    9091
    9192      - name: Make Composer packages available globally
    9293        run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    9394
    94       - name: Log PHPCS debug information
    95         run: phpcs -i
     95      - name: Run PHP compatibility tests
     96        id: phpcs
     97        run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml
    9698
    97       - name: Run PHP compatibility tests
    98         run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
     99      - name: Show PHPCompatibility results in PR
     100        if: ${{ always() && steps.phpcs.outcome == 'failure' }}
     101        run: cs2pr ./.cache/phpcs-compat-report.xml
    99102
    100103      - name: Ensure version-controlled files are not modified or deleted
     
    113116      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
    114117      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
     118
     119  failed-workflow:
     120    name: Failed workflow tasks
     121    runs-on: ubuntu-latest
     122    needs: [ php-compatibility, slack-notifications ]
     123    if: |
     124      always() &&
     125      github.repository == 'WordPress/wordpress-develop' &&
     126      github.event_name != 'pull_request' &&
     127      github.run_attempt < 2 &&
     128      (
     129        needs.php-compatibility.result == 'cancelled' || needs.php-compatibility.result == 'failure'
     130      )
     131
     132    steps:
     133      - name: Dispatch workflow run
     134        uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
     135        with:
     136          retries: 2
     137          retry-exempt-status-codes: 418
     138          script: |
     139            github.rest.actions.createWorkflowDispatch({
     140              owner: context.repo.owner,
     141              repo: context.repo.repo,
     142              workflow_id: 'failed-workflow.yml',
     143              ref: 'trunk',
     144              inputs: {
     145                run_id: '${{ github.run_id }}'
     146              }
     147            });
Note: See TracChangeset for help on using the changeset viewer.