From ee3c8fc4304da50c5f73b022b039794524dc9e9e Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 7 Aug 2026 11:49:38 +0200 Subject: [PATCH 1/3] Try different matrix approach --- .github/workflows/testing.yml | 55 +++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e62cb3e0..3fbce18c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -10,9 +10,28 @@ on: schedule: - cron: '17 1 * * *' # Run every day on a seemly random time. +permissions: + contents: read + +# Previously inherited from reusable-testing.yml. The fan-out below is owned by +# this file now, so the concurrency group has to live here too. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +# Trial of the fanned-out shape from wp-cli/.github#277. A matrix only becomes a +# collapsible group in the Actions run view when it sits on a job declared in the +# workflow the run belongs to, so the legs are started from here rather than from +# inside reusable-testing.yml. +# +# TODO: the three refs below point at the pull request branch because +# reusable-prepare-matrix.yml does not exist on main yet. Switch them to @main +# once wp-cli/.github#277 is merged. jobs: - test: - uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main + prepare: + name: Prepare test matrices + uses: wp-cli/.github/.github/workflows/reusable-prepare-matrix.yml@claude/wp-cli-actions-optimization-mozclo + # Carried over unchanged from the previous `test` job. with: matrix: | { @@ -44,3 +63,35 @@ jobs: ], "exclude": [] } + + unit: + needs: prepare + if: ${{ needs.prepare.outputs.unit != '' }} + name: Unit | PHP ${{ matrix.php }} + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.prepare.outputs.unit) }} + uses: wp-cli/.github/.github/workflows/reusable-unit.yml@claude/wp-cli-actions-optimization-mozclo + secrets: inherit + with: + php: ${{ matrix.php }} + coverage: ${{ matrix.coverage == true }} + os: ${{ matrix.os || '' }} + + functional: + needs: prepare + if: ${{ needs.prepare.outputs.functional != '' }} + name: Behat | PHP ${{ matrix.php }} + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.prepare.outputs.functional) }} + uses: wp-cli/.github/.github/workflows/reusable-functional.yml@claude/wp-cli-actions-optimization-mozclo + secrets: inherit + with: + php: ${{ matrix.php }} + wp: ${{ matrix.wp }} + dbtype: ${{ matrix.dbtype || 'mysql' }} + mysql: ${{ matrix.mysql || '' }} + object_cache: ${{ matrix.object_cache }} + coverage: ${{ matrix.coverage == true }} + os: ${{ matrix.os || '' }} From 2499891a7e9b836d54f6b5629dfa4c2996907acc Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 7 Aug 2026 15:49:33 +0200 Subject: [PATCH 2/3] Apply update --- .github/workflows/testing.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3fbce18c..1e1f4fc0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -67,7 +67,9 @@ jobs: unit: needs: prepare if: ${{ needs.prepare.outputs.unit != '' }} - name: Unit | PHP ${{ matrix.php }} + # Deliberately not "Unit | PHP ${{ matrix.php }}": there is only one unit leg + # per PHP version, so that would produce nine groups of one job each. + name: Unit strategy: fail-fast: false matrix: ${{ fromJson(needs.prepare.outputs.unit) }} @@ -77,6 +79,8 @@ jobs: php: ${{ matrix.php }} coverage: ${{ matrix.coverage == true }} os: ${{ matrix.os || '' }} + # The job name above already states the suite and PHP version. + grouped: true functional: needs: prepare @@ -95,3 +99,5 @@ jobs: object_cache: ${{ matrix.object_cache }} coverage: ${{ matrix.coverage == true }} os: ${{ matrix.os || '' }} + # The job name above already states the suite and PHP version. + grouped: true From e2ab98345798aea2ecd2af147d073eb26979706f Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 7 Aug 2026 22:11:12 +0200 Subject: [PATCH 3/3] fix unit test grouping --- .github/workflows/testing.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1e1f4fc0..dad20dd5 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -67,9 +67,10 @@ jobs: unit: needs: prepare if: ${{ needs.prepare.outputs.unit != '' }} - # Deliberately not "Unit | PHP ${{ matrix.php }}": there is only one unit leg - # per PHP version, so that would produce nine groups of one job each. - name: Unit + # Must vary by the dimension being grouped on and collide across every other. + # A name that does not vary with the matrix gets the matrix combination + # appended by GitHub, giving one group per leg. + name: Unit | PHP ${{ matrix.php }} strategy: fail-fast: false matrix: ${{ fromJson(needs.prepare.outputs.unit) }}