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

    r51357 r53597  
    22
    33on:
    4   # The end to end test suite was introduced in WordPress 5.3.
     4  # The end-to-end test suite was introduced in WordPress 5.3.
    55  push:
    66    branches:
    7       - master
    87      - trunk
    98      - '5.[3-9]'
     
    1413  pull_request:
    1514    branches:
    16       - master
    1715      - trunk
    1816      - '5.[3-9]'
     
    3432  #
    3533  # Performs the following steps:
    36   # - Set environment variables.
     34  # - Sets environment variables.
    3735  # - Checks out the repository.
    38   # - Logs debug information about the runner container.
    39   # - Installs NodeJS 14.
     36  # - Logs debug information about the GitHub Action runner.
     37  # - Installs NodeJS.
    4038  # - Sets up caching for NPM.
    41   # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     39  # _ Installs NPM dependencies.
    4240  # - Builds WordPress to run from the `build` directory.
    4341  # - Starts the WordPress Docker container.
     
    4846  # - Run the E2E tests.
    4947  # - Ensures version-controlled files are not modified or deleted.
    50   # - todo: Configure Slack notifications for failing tests.
    5148  e2e-tests:
    5249    name: E2E Tests
    5350    runs-on: ubuntu-latest
     51    timeout-minutes: 20
    5452    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    5553
     
    6159
    6260      - name: Checkout repository
    63         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     61        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    6462
    6563      - name: Log debug information
     
    7573
    7674      - name: Install NodeJS
    77         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     75        uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    7876        with:
    79           node-version: 14
    80 
    81       - name: Cache NodeJS modules
    82         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    83         env:
    84           cache-name: cache-node-modules
    85         with:
    86           # npm cache files are stored in `~/.npm` on Linux/macOS
    87           path: ~/.npm
    88           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     77          node-version-file: '.nvmrc'
     78          cache: npm
    8979
    9080      - name: Install Dependencies
     
    127117      - name: Ensure version-controlled files are not modified or deleted
    128118        run: git diff --exit-code
     119
     120  slack-notifications:
     121    name: Slack Notifications
     122    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
     123    needs: [ e2e-tests ]
     124    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
     125    with:
     126      calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }}
     127    secrets:
     128      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     129      SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
     130      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
     131      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset for help on using the changeset viewer.