Make WordPress Core


Ignore:
Timestamp:
06/30/2022 04:26:30 PM (4 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.

Merges [51921], [51924], [51925], [51937], [52002], [52130], [52183], [52233], [53112], [53581], [53582], [53592] to the 5.8 branch.
See #56095.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

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

    r51357 r53597  
    66  push:
    77    branches:
    8       - master
    98      - trunk
    109      - '3.[89]'
     
    1514  pull_request:
    1615    branches:
    17       - master
    1816      - trunk
    1917      - '3.[89]'
     
    6159    name: PHP coding standards
    6260    runs-on: ubuntu-latest
     61    timeout-minutes: 20
    6362    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    6463
    6564    steps:
    6665      - name: Checkout repository
    67         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     66        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    6867
    6968      - name: Set up PHP
    70         uses: shivammathur/setup-php@afefcaf556d98dc7896cca380e181decb609ca44 # v2.10.0
     69        uses: shivammathur/setup-php@3eda58347216592f618bb1dff277810b6698e4ca # v2.19.1
    7170        with:
    7271          php-version: '7.4'
     
    8079
    8180      - name: Install Composer dependencies
    82         uses: ramsey/composer-install@92a7904348d4ad30236f3611e33b7f0c6f9edd70 # v1.1.0
     81        uses: ramsey/composer-install@f680dac46551dffb2234a240d65ae806c2999dd6 # v2.1.0
    8382        with:
    8483          composer-options: "--no-progress --no-ansi --no-interaction"
     
    105104  # Performs the following steps:
    106105  # - Checks out the repository.
    107   # - Logs debug information about the runner container.
    108   # - Installs NodeJS 14.
     106  # - Logs debug information about the GitHub Action runner.
     107  # - Installs NodeJS.
    109108  # - Sets up caching for NPM.
    110109  # - Logs updated debug information.
    111   # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     110  # _ Installs NPM dependencies.
    112111  # - Run the WordPress JSHint checks.
    113112  # - Ensures version-controlled files are not modified or deleted.
    114   # - todo: Configure Slack notifications for failing tests.
    115113  jshint:
    116114    name: JavaScript coding standards
    117115    runs-on: ubuntu-latest
     116    timeout-minutes: 20
    118117    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    119118    env:
     
    122121    steps:
    123122      - name: Checkout repository
    124         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     123        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    125124
    126125      - name: Log debug information
     
    132131
    133132      - name: Install NodeJS
    134         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     133        uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    135134        with:
    136           node-version: 14
    137 
    138       - name: Cache NodeJS modules
    139         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    140         env:
    141           cache-name: cache-node-modules
    142         with:
    143           # npm cache files are stored in `~/.npm` on Linux/macOS
    144           path: ~/.npm
    145           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     135          node-version-file: '.nvmrc'
     136          cache: npm
    146137
    147138      - name: Log debug information
     
    158149      - name: Ensure version-controlled files are not modified or deleted
    159150        run: git diff --exit-code
     151
     152  slack-notifications:
     153    name: Slack Notifications
     154    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
     155    needs: [ phpcs, jshint ]
     156    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
     157    with:
     158      calling_status: ${{ needs.phpcs.result == 'success' && needs.jshint.result == 'success' && 'success' || ( needs.phpcs.result == 'cancelled' || needs.jshint.result == 'cancelled' ) && 'cancelled' || 'failure' }}
     159    secrets:
     160      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     161      SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
     162      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
     163      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset for help on using the changeset viewer.