Make WordPress Core


Ignore:
Timestamp:
06/30/2022 04:40:40 PM (2 years ago)
Author:
desrosj
Message:

Build/Test Tools: Use the Slack notifications workflow as a reusable one.

This backports several changesets that are required to remove the reliance on the workflow_run event for posting Slack notifications.

The Slack notification workflow will now be called as a reusable one, which has several benefits (see [53591]).

Several other minor GitHub Actions related updates are also being backported in this commit to maintain tooling consistency across branches that still receive security updates as a courtesy when necessary.

Workflows that are not relevant to this branch that were mistakenly backported are also being deleted.

Merges [50473], [50704], [50796], [50930], [51341], [51355], [51498], [51511], [51535], [51924], [51925], [51937], [52002], [52130], [52183], [52233], [53112], [53581], [53582], [53592] to the 5.2 branch.
See #56095.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/.github/workflows/coding-standards.yml

    r50606 r53603  
    66  push:
    77    branches:
    8       - master
    98      - trunk
    109      - '3.[89]'
     
    1514  pull_request:
    1615    branches:
    17       - master
    1816      - trunk
    1917      - '3.[89]'
     
    3533  workflow_dispatch:
    3634
     35# Cancels all previous workflow runs for pull requests that have not completed.
     36concurrency:
     37  # The concurrency group contains the workflow name and the branch name for pull requests
     38  # or the commit hash for any other events.
     39  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     40  cancel-in-progress: true
     41
    3742jobs:
    3843  # Runs PHP coding standards checks.
     
    4954  # - Runs PHPCS on the full codebase with warnings suppressed.
    5055  # - Runs PHPCS on the `tests` directory without warnings suppressed.
    51   # - todo: Configure Slack notifications for failing scans.
    5256  phpcs:
    5357    name: PHP coding standards
    5458    runs-on: ubuntu-latest
     59    timeout-minutes: 20
    5560    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    5661
    5762    steps:
    5863      - name: Checkout repository
    59         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     64        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    6065
    6166      - name: Set up PHP
    62         uses: shivammathur/setup-php@afefcaf556d98dc7896cca380e181decb609ca44 # v2.10.0
     67        uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
    6368        with:
    6469          php-version: '7.3'
     
    7277
    7378      - name: Install Composer dependencies
    74         uses: ramsey/composer-install@92a7904348d4ad30236f3611e33b7f0c6f9edd70 # v1.1.0
     79        uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
    7580        with:
    7681          composer-options: "--no-progress --no-ansi --no-interaction"
     
    9196  # Performs the following steps:
    9297  # - Checks out the repository.
    93   # - Logs debug information about the runner container.
    94   # - Installs NodeJS 14.
    95   # - Sets up caching for NPM.
     98  # - Logs debug information about the GitHub Action runner.
     99  # - Installs NodeJS.
    96100  # - Logs updated debug information.
    97   # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     101  # _ Installs NPM dependencies.
    98102  # - Run the WordPress JSHint checks.
    99   # - todo: Configure Slack notifications for failing tests.
    100103  jshint:
    101104    name: JavaScript coding standards
    102105    runs-on: ubuntu-latest
     106    timeout-minutes: 20
    103107    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    104108    env:
     
    107111    steps:
    108112      - name: Checkout repository
    109         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     113        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    110114
    111115      - name: Log debug information
     
    117121
    118122      - name: Install NodeJS
    119         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     123        uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    120124        with:
    121           node-version: 14
    122 
    123       - name: Cache NodeJS modules
    124         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    125         env:
    126           cache-name: cache-node-modules
    127         with:
    128           # npm cache files are stored in `~/.npm` on Linux/macOS
    129           path: ~/.npm
    130           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     125          node-version-file: '.nvmrc'
     126          cache: npm
    131127
    132128      - name: Log debug information
     
    140136      - name: Run JSHint
    141137        run: npm run grunt jshint
     138
     139  slack-notifications:
     140    name: Slack Notifications
     141    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
     142    needs: [ phpcs, jshint ]
     143    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
     144    with:
     145      calling_status: ${{ needs.phpcs.result == 'success' && needs.jshint.result == 'success' && 'success' || ( needs.phpcs.result == 'cancelled' || needs.jshint.result == 'cancelled' ) && 'cancelled' || 'failure' }}
     146    secrets:
     147      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     148      SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
     149      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
     150      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset for help on using the changeset viewer.