Make WordPress Core

source: branches/5.7/.github/workflows/phpunit-tests.yml @ 58598

Last change on this file since 58598 was 58598, checked in by desrosj, 3 weeks ago

Build/Test Tools: Make use of new reusable workflows for 5.7.

This updates the 5.7 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

  • The image and platform properties for the mysql container have been updated to always prefer amd64 containers (#60822).
  • macos-13 is now pinned for MacOS jobs instead of macos-latest (#61340).
  • Run E2E tests with and without SCRIPT_DEBUG (#58661).
  • Migrating to Docker Compose V2 (#60901).
  • Removing the version property from docker-compose.yml (#59416).
  • Improvements to how artifacts and comments for Playground testing are generated.
  • Removing SVN related commands causing failures (#61216).
  • Updating the actions/github-scripts action to the latest version.
  • Cache the results of PHP_CodeSniffer runs (#49783).
  • A fix to grunt clean to prevent script-loader-packages.php from being deleted (#53606).

Merges [51355], [52179], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 5.7 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen, jrf.
See #48783, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661, #53606.

  • Property svn:eol-style set to native
File size: 4.3 KB
Line 
1name: PHPUnit Tests
2
3on:
4  push:
5    branches:
6      - trunk
7      - '3.[7-9]'
8      - '[4-9].[0-9]'
9    tags:
10      - '[0-9]+.[0-9]'
11      - '[0-9]+.[0-9].[0-9]+'
12  pull_request:
13    branches:
14      - trunk
15      - '3.[7-9]'
16      - '[4-9].[0-9]'
17  workflow_dispatch:
18  # Once weekly On Sundays at 00:00 UTC.
19  schedule:
20    - cron: '0 0 * * 0'
21
22# Cancels all previous workflow runs for pull requests that have not completed.
23concurrency:
24  # The concurrency group contains the workflow name and the branch name for pull requests
25  # or the commit hash for any other events.
26  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
27  cancel-in-progress: true
28
29# Disable permissions for all available scopes by default.
30# Any needed permissions should be configured at the job level.
31permissions: {}
32
33jobs:
34  # Creates PHPUnit test jobs.
35  test-php:
36    name: PHP ${{ matrix.php }}
37    uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v2.yml@trunk
38    permissions:
39      contents: read
40    secrets: inherit
41    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
42    strategy:
43      fail-fast: false
44      matrix:
45        os: [ ubuntu-latest ]
46        php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ]
47        multisite: [ false, true ]
48        split_slow: [ false ]
49        memcached: [ false ]
50        include:
51          # Additional "slow" jobs for PHP 5.6.
52          - php: '5.6'
53            os: ubuntu-latest
54            memcached: false
55            multisite: false
56            split_slow: true
57          - php: '5.6'
58            os: ubuntu-latest
59            memcached: false
60            multisite: true
61            split_slow: true
62          # Include jobs for PHP 7.4 with memcached.
63          - php: '7.4'
64            os: ubuntu-latest
65            memcached: true
66            multisite: false
67          - php: '7.4'
68            os: ubuntu-latest
69            memcached: true
70            multisite: true
71          # Report the results of the PHP 7.4 without memcached job.
72          - php: '7.4'
73            os: ubuntu-latest
74            memcached: false
75            multisite: false
76            report: true
77    with:
78      os: ${{ matrix.os }}
79      php: ${{ matrix.php }}
80      multisite: ${{ matrix.multisite }}
81      split_slow: ${{ matrix.split_slow }}
82      memcached: ${{ matrix.memcached }}
83      phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }}
84      report: ${{ matrix.report || false }}
85
86  slack-notifications:
87    name: Slack Notifications
88    uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
89    permissions:
90      actions: read
91      contents: read
92    needs: [ test-php ]
93    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
94    with:
95      calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
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 }}
101
102  failed-workflow:
103    name: Failed workflow tasks
104    runs-on: ubuntu-latest
105    permissions:
106      actions: write
107    needs: [ slack-notifications ]
108    if: |
109      always() &&
110      github.repository == 'WordPress/wordpress-develop' &&
111      github.event_name != 'pull_request' &&
112      github.run_attempt < 2 &&
113      (
114        contains( needs.*.result, 'cancelled' ) ||
115        contains( needs.*.result, 'failure' )
116      )
117
118    steps:
119      - name: Dispatch workflow run
120        uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
121        with:
122          retries: 2
123          retry-exempt-status-codes: 418
124          script: |
125            github.rest.actions.createWorkflowDispatch({
126              owner: context.repo.owner,
127              repo: context.repo.repo,
128              workflow_id: 'failed-workflow.yml',
129              ref: 'trunk',
130              inputs: {
131                run_id: '${{ github.run_id }}'
132              }
133            });
Note: See TracBrowser for help on using the repository browser.