Make WordPress Core


Ignore:
Timestamp:
06/30/2022 04:34:14 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 [50446], [50473], [50704], [50796], [50930], [51341], [51355], [51498], [51511], [51535], [51924], [51925], [51937], [52002], [52130], [52183], [52233], [53112], [53581], [53582], [53592] to the 5.7 branch.
See #56095.

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

  • branches/5.7/.github/workflows/end-to-end-tests.yml

    r50591 r53598  
    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]'
    1917      - '[6-9].[0-9]'
    2018  workflow_dispatch:
     19
     20# Cancels all previous workflow runs for pull requests that have not completed.
     21concurrency:
     22  # The concurrency group contains the workflow name and the branch name for pull requests
     23  # or the commit hash for any other events.
     24  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
     25  cancel-in-progress: true
    2126
    2227env:
     
    2732  #
    2833  # Performs the following steps:
    29   # - Cancels all previous workflow runs for pull requests that have not completed.
    30   # - Set environment variables.
     34  # - Sets environment variables.
    3135  # - Checks out the repository.
    32   # - Logs debug information about the runner container.
    33   # - Installs NodeJS 14.
    34   # - Sets up caching for NPM.
    35   # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     36  # - Logs debug information about the GitHub Action runner.
     37  # - Installs NodeJS.
     38  # _ Installs NPM dependencies.
    3639  # - Builds WordPress to run from the `build` directory.
    3740  # - Starts the WordPress Docker container.
     
    4144  # - Install WordPress within the Docker container.
    4245  # - Run the E2E tests.
    43   # - todo: Configure Slack notifications for failing tests.
    4446  e2e-tests:
    4547    name: E2E Tests
    4648    runs-on: ubuntu-latest
     49    timeout-minutes: 20
    4750    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    4851
    4952    steps:
    50       - name: Cancel previous runs of this workflow (pull requests only)
    51         if: ${{ github.event_name == 'pull_request' }}
    52         uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0
    53 
    5453      - name: Configure environment variables
    5554        run: |
     
    5857
    5958      - name: Checkout repository
    60         uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
     59        uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
    6160
    6261      - name: Log debug information
     
    7271
    7372      - name: Install NodeJS
    74         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     73        uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
    7574        with:
    76           node-version: 14
    77 
    78       - name: Cache NodeJS modules
    79         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    80         env:
    81           cache-name: cache-node-modules
    82         with:
    83           # npm cache files are stored in `~/.npm` on Linux/macOS
    84           path: ~/.npm
    85           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     75          node-version-file: '.nvmrc'
     76          cache: npm
    8677
    8778      - name: Install Dependencies
     
    121112      - name: Run E2E tests
    122113        run: npm run test:e2e
     114
     115  slack-notifications:
     116    name: Slack Notifications
     117    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
     118    needs: [ e2e-tests ]
     119    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
     120    with:
     121      calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }}
     122    secrets:
     123      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     124      SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
     125      SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
     126      SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }}
Note: See TracChangeset for help on using the changeset viewer.