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/javascript-tests.yml

    r51357 r53597  
    55  push:
    66    branches:
    7       - master
    87      - trunk
    98      - '3.[89]'
     
    1413  pull_request:
    1514    branches:
    16       - master
    1715      - trunk
    1816      - '3.[89]'
     
    4543  # Performs the following steps:
    4644  # - Checks out the repository.
    47   # - Logs debug information about the runner container.
    48   # - Installs NodeJS 14.
     45  # - Logs debug information about the GitHub Action runner.
     46  # - Installs NodeJS.
    4947  # - Sets up caching for NPM.
    5048  # - Logs updated debug information.
    51   # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     49  # _ Installs NPM dependencies.
    5250  # - Run the WordPress QUnit tests.
    5351  # - Ensures version-controlled files are not modified or deleted.
    54   # - todo: Configure Slack notifications for failing tests.
    5552  test-js:
    5653    name: QUnit Tests
    5754    runs-on: ubuntu-latest
     55    timeout-minutes: 20
    5856    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    5957
    6058    steps:
    6159      - name: Checkout repository
    62         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     60        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    6361
    6462      - name: Log debug information
     
    7068
    7169      - name: Install NodeJS
    72         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     70        uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    7371        with:
    74           node-version: 14
    75 
    76       - name: Cache NodeJS modules
    77         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    78         env:
    79           cache-name: cache-node-modules
    80         with:
    81           # npm cache files are stored in `~/.npm` on Linux/macOS
    82           path: ~/.npm
    83           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     72          node-version-file: '.nvmrc'
     73          cache: npm
    8474
    8575      - name: Log debug information
     
    9686      - name: Ensure version-controlled files are not modified or deleted
    9787        run: git diff --exit-code
     88
     89  slack-notifications:
     90    name: Slack Notifications
     91    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
     92    needs: [ test-js ]
     93    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
     94    with:
     95      calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
     96    secrets:
     97      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     98      SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
     99      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
     100      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset for help on using the changeset viewer.