Skip to content

Commit ee3c8fc

Browse files
committed
Try different matrix approach
1 parent 4b2caf3 commit ee3c8fc

1 file changed

Lines changed: 53 additions & 2 deletions

File tree

‎.github/workflows/testing.yml‎

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,28 @@ on:
1010
schedule:
1111
- cron: '17 1 * * *' # Run every day on a seemly random time.
1212

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.
1330
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.
1635
with:
1736
matrix: |
1837
{
@@ -44,3 +63,35 @@ jobs:
4463
],
4564
"exclude": []
4665
}
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

Comments
 (0)