From ee3c8fc4304da50c5f73b022b039794524dc9e9e Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Fri, 7 Aug 2026 11:49:38 +0200 Subject: [PATCH 1/4] 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 e62cb3e04..3fbce18cc 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/4] 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 3fbce18cc..1e1f4fc0f 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/4] 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 1e1f4fc0f..dad20dd52 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) }} From 0a787ec9953ab431badac20351140bb595a1d7db Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 24 Nov 2026 10:16:33 +0000 Subject: [PATCH 4/4] Point the trial at the head of wp-cli/.github#282 The prototype branch of wp-cli/.github#277 was deleted when it got merged and reverted, so the three reusable workflow refs no longer resolve and every run would fail. #282 restores the same change; pin to its head commit so the trial keeps running even if that branch is renamed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx --- .github/workflows/testing.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index dad20dd52..0b14717dc 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -19,18 +19,18 @@ 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 +# Trial of the fanned-out shape from wp-cli/.github#282. 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 +# TODO: the three refs below are pinned to the head of wp-cli/.github#282 because # reusable-prepare-matrix.yml does not exist on main yet. Switch them to @main -# once wp-cli/.github#277 is merged. +# once that is merged. jobs: prepare: name: Prepare test matrices - uses: wp-cli/.github/.github/workflows/reusable-prepare-matrix.yml@claude/wp-cli-actions-optimization-mozclo + uses: wp-cli/.github/.github/workflows/reusable-prepare-matrix.yml@80540c1216ca1c4f64f2d17a4d85906f7a7d44b9 # Carried over unchanged from the previous `test` job. with: matrix: | @@ -74,7 +74,7 @@ jobs: 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 + uses: wp-cli/.github/.github/workflows/reusable-unit.yml@80540c1216ca1c4f64f2d17a4d85906f7a7d44b9 secrets: inherit with: php: ${{ matrix.php }} @@ -90,7 +90,7 @@ jobs: 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 + uses: wp-cli/.github/.github/workflows/reusable-functional.yml@80540c1216ca1c4f64f2d17a4d85906f7a7d44b9 secrets: inherit with: php: ${{ matrix.php }}