|
10 | 10 | schedule: |
11 | 11 | - cron: '17 1 * * *' # Run every day on a seemly random time. |
12 | 12 |
|
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +# Previously inherited from reusable-testing.yml. The fan-out below is owned by |
| 17 | +# this file now, so the concurrency group has to live here too. |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} |
| 20 | + cancel-in-progress: true |
| 21 | + |
| 22 | +# Trial of the fanned-out shape from wp-cli/.github#277. A matrix only becomes a |
| 23 | +# collapsible group in the Actions run view when it sits on a job declared in the |
| 24 | +# workflow the run belongs to, so the legs are started from here rather than from |
| 25 | +# inside reusable-testing.yml. |
| 26 | +# |
| 27 | +# TODO: the three refs below point at the pull request branch because |
| 28 | +# reusable-prepare-matrix.yml does not exist on main yet. Switch them to @main |
| 29 | +# once wp-cli/.github#277 is merged. |
13 | 30 | jobs: |
14 | | - test: |
15 | | - uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main |
| 31 | + prepare: |
| 32 | + name: Prepare test matrices |
| 33 | + uses: wp-cli/.github/.github/workflows/reusable-prepare-matrix.yml@claude/wp-cli-actions-optimization-mozclo |
| 34 | + # Carried over unchanged from the previous `test` job. |
16 | 35 | with: |
17 | 36 | matrix: | |
18 | 37 | { |
|
44 | 63 | ], |
45 | 64 | "exclude": [] |
46 | 65 | } |
| 66 | +
|
| 67 | + unit: |
| 68 | + needs: prepare |
| 69 | + if: ${{ needs.prepare.outputs.unit != '' }} |
| 70 | + name: Unit | PHP ${{ matrix.php }} |
| 71 | + strategy: |
| 72 | + fail-fast: false |
| 73 | + matrix: ${{ fromJson(needs.prepare.outputs.unit) }} |
| 74 | + uses: wp-cli/.github/.github/workflows/reusable-unit.yml@claude/wp-cli-actions-optimization-mozclo |
| 75 | + secrets: inherit |
| 76 | + with: |
| 77 | + php: ${{ matrix.php }} |
| 78 | + coverage: ${{ matrix.coverage == true }} |
| 79 | + os: ${{ matrix.os || '' }} |
| 80 | + |
| 81 | + functional: |
| 82 | + needs: prepare |
| 83 | + if: ${{ needs.prepare.outputs.functional != '' }} |
| 84 | + name: Behat | PHP ${{ matrix.php }} |
| 85 | + strategy: |
| 86 | + fail-fast: false |
| 87 | + matrix: ${{ fromJson(needs.prepare.outputs.functional) }} |
| 88 | + uses: wp-cli/.github/.github/workflows/reusable-functional.yml@claude/wp-cli-actions-optimization-mozclo |
| 89 | + secrets: inherit |
| 90 | + with: |
| 91 | + php: ${{ matrix.php }} |
| 92 | + wp: ${{ matrix.wp }} |
| 93 | + dbtype: ${{ matrix.dbtype || 'mysql' }} |
| 94 | + mysql: ${{ matrix.mysql || '' }} |
| 95 | + object_cache: ${{ matrix.object_cache }} |
| 96 | + coverage: ${{ matrix.coverage == true }} |
| 97 | + os: ${{ matrix.os || '' }} |
0 commit comments