@@ -110,7 +110,7 @@ See [action.yml](action.yml) and the underlying script [`typisttech/php-matrix`]
110110# # Examples
111111
112112<details open>
113- <summary>Run tests against all supported PHP minor versions.</summary>
113+ <summary>Run tests against all supported PHP versions.</summary>
114114
115115` ` ` yaml
116116name: Test
@@ -124,7 +124,11 @@ jobs:
124124 outputs:
125125 versions: ${{ steps.php-matrix.outputs.versions }}
126126 steps:
127- - uses: actions/checkout@v4
127+ - uses: actions/checkout@v5
128+ with:
129+ sparse-checkout: composer.json
130+ sparse-checkout-cone-mode: false
131+
128132 - uses: typisttech/php-matrix-action@v2
129133 id: php-matrix
130134
@@ -133,49 +137,80 @@ jobs:
133137 needs: php-matrix
134138 strategy:
135139 matrix:
136- php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
140+ php-version : ${{ fromJSON(needs.php-matrix.outputs.versions) }}
137141 steps:
138- - uses: actions/checkout@v4
142+ - uses: actions/checkout@v5
139143 - uses: shivammathur/setup-php@v2
140144 with:
141- php-version: ${{ matrix.php }}
145+ php-version: ${{ matrix.php-version }}
142146 - run: composer install
143147 - run: composer test
144148` ` `
145149
146150</details>
147151
148152<details>
149- <summary>Run `phpstan` with the lowest supported PHP minor version .</summary>
153+ <summary>Run `$ composer audit` against all supported PHP versions .</summary>
150154
151155` ` ` yaml
152- name: PHPStan
156+ name: Composer Audit
153157
154158on:
155159 push:
156160
157161jobs:
158- phpstan :
162+ php-matrix :
159163 runs-on: ubuntu-latest
164+ outputs:
165+ versions: ${{ steps.php-matrix.outputs.versions }}
166+ highest: ${{ steps.php-matrix.outputs.highest }}
167+ lowest: ${{ steps.php-matrix.outputs.lowest }}
160168 steps:
161- - uses: actions/checkout@v4
169+ - uses: actions/checkout@v5
170+ with:
171+ sparse-checkout: composer.json
172+ sparse-checkout-cone-mode: false
162173
163174 - uses: typisttech/php-matrix-action@v2
164175 id: php-matrix
165176
166- - uses: shivammathur/setup-php@v2
177+ composer-audit:
178+ needs: php-matrix
179+ runs-on: ubuntu-latest
180+ strategy:
181+ matrix:
182+ php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
183+ dependency-versions: [highest]
184+ include:
185+ - php-version: ${{ needs.php-matrix.outputs.lowest }}
186+ dependency-versions: lowest
187+ - php-version: ${{ needs.php-matrix.outputs.highest }}
188+ dependency-versions: locked
189+ env:
190+ COMPOSER_NO_AUDIT: 1
191+ steps:
192+ - uses: actions/checkout@v5
167193 with:
168- php-version: ${{ steps.php-matrix.outputs.lowest }}
194+ sparse-checkout: |
195+ composer.json
196+ composer.lock
197+ sparse-checkout-cone-mode: false
169198
170- - run: composer install
199+ - uses: shivammathur/setup-php@v2
200+ with:
201+ php-version: ${{ matrix.php-version }}
202+ coverage: none
203+ - uses: ramsey/composer-install@v3
204+ with:
205+ dependency-versions: ${{ matrix.dependency-versions }}
171206
172- - run: vendor/bin/phpstan analyse src
207+ - run: composer audit
173208` ` `
174209
175210</details>
176211
177212<details>
178- <summary>Run tests with coverage.</summary>
213+ <summary>Run tests with coverage on the highest supported PHP version .</summary>
179214
180215` ` ` yaml
181216name: Test
@@ -190,7 +225,7 @@ jobs:
190225 versions: ${{ steps.php-matrix.outputs.versions }}
191226 highest: ${{ steps.php-matrix.outputs.highest }}
192227 steps:
193- - uses: actions/checkout@v4
228+ - uses: actions/checkout@v5
194229 with:
195230 sparse-checkout: composer.json
196231 sparse-checkout-cone-mode: false
@@ -203,34 +238,25 @@ jobs:
203238 needs: php-matrix
204239 strategy:
205240 matrix:
206- php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
207- dependency-versions: [lowest, highest]
241+ php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
208242 coverage: [none]
209243 exclude:
210- - php: ${{ needs.php-matrix.outputs.highest }}
211- dependency-versions: highest
244+ - php-version: ${{ needs.php-matrix.outputs.highest }}
212245 coverage: none
213246 include:
214- - php: ${{ needs.php-matrix.outputs.highest }}
215- dependency-versions: highest
247+ - php-version: ${{ needs.php-matrix.outputs.highest }}
216248 coverage: xdebug
217249 steps:
218- - uses: actions/checkout@v4
250+ - uses: actions/checkout@v5
219251
220252 - uses: shivammathur/setup-php@v2
221253 with:
222- php-version: ${{ matrix.php }}
254+ php-version: ${{ matrix.php-version }}
223255 coverage: ${{ matrix.coverage }}
224- env:
225- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226-
227- - uses: ramsey/composer-install@v3
228- with:
229- dependency-versions: ${{ matrix.dependency-versions }}
256+ - run: composer install
230257
231258 - run: composer test:with-coverage
232259 if: ${{ matrix.coverage == 'xdebug' }}
233-
234260 - run: composer test:without-coverage
235261 if: ${{ matrix.coverage != 'xdebug' }}
236262` ` `
0 commit comments