@@ -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,52 +137,50 @@ 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` ` `
145-
146149</details>
147150
148151<details>
149- <summary>Run `phpstan` with the lowest supported PHP minor version.</summary>
152+ <summary>Run tests on the highest supported PHP version only .</summary>
150153
151154` ` ` yaml
152- name: PHPStan
155+ name: Test
153156
154157on:
155158 push:
156159
157160jobs:
158- phpstan :
161+ test :
159162 runs-on: ubuntu-latest
160163 steps:
161- - uses: actions/checkout@v4
164+ - uses: actions/checkout@v5
162165
163166 - uses: typisttech/php-matrix-action@v2
164167 id: php-matrix
165168
166169 - uses: shivammathur/setup-php@v2
167170 with:
168- php-version: ${{ steps.php-matrix.outputs.lowest }}
171+ php-version: ${{ steps.php-matrix.outputs.highest }}
169172
170173 - run: composer install
171174
172- - run: vendor/bin/phpstan analyse src
175+ - run: composer test
173176` ` `
174-
175177</details>
176178
177179<details>
178- <summary>Run tests with coverage .</summary>
180+ <summary>Run `$ composer audit` against all supported PHP versions .</summary>
179181
180182` ` ` yaml
181- name: Test
183+ name: Composer Audit
182184
183185on:
184186 push:
@@ -189,52 +191,48 @@ jobs:
189191 outputs:
190192 versions: ${{ steps.php-matrix.outputs.versions }}
191193 highest: ${{ steps.php-matrix.outputs.highest }}
194+ lowest: ${{ steps.php-matrix.outputs.lowest }}
192195 steps:
193- - uses: actions/checkout@v4
196+ - uses: actions/checkout@v5
194197 with:
195198 sparse-checkout: composer.json
196199 sparse-checkout-cone-mode: false
197200
198201 - uses: typisttech/php-matrix-action@v2
199202 id: php-matrix
200203
201- test:
202- runs-on: ubuntu-latest
204+ composer-audit:
203205 needs: php-matrix
206+ runs-on: ubuntu-latest
204207 strategy:
205208 matrix:
206- php: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
207- dependency-versions: [lowest, highest]
208- coverage: [none]
209- exclude:
210- - php: ${{ needs.php-matrix.outputs.highest }}
211- dependency-versions: highest
212- coverage: none
209+ php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
210+ dependency-versions: [highest]
213211 include:
214- - php: ${{ needs.php-matrix.outputs.highest }}
215- dependency-versions: highest
216- coverage: xdebug
212+ - php-version: ${{ needs.php-matrix.outputs.lowest }}
213+ dependency-versions: lowest
214+ - php-version: ${{ needs.php-matrix.outputs.highest }}
215+ dependency-versions: locked
216+ env:
217+ COMPOSER_NO_AUDIT: 1
217218 steps:
218- - uses: actions/checkout@v4
219+ - uses: actions/checkout@v5
220+ with:
221+ sparse-checkout: |
222+ composer.json
223+ composer.lock
224+ sparse-checkout-cone-mode: false
219225
220226 - uses: shivammathur/setup-php@v2
221227 with:
222- php-version: ${{ matrix.php }}
223- coverage: ${{ matrix.coverage }}
224- env:
225- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226-
228+ php-version: ${{ matrix.php-version }}
229+ coverage: none
227230 - uses: ramsey/composer-install@v3
228231 with:
229232 dependency-versions: ${{ matrix.dependency-versions }}
230233
231- - run: composer test:with-coverage
232- if: ${{ matrix.coverage == 'xdebug' }}
233-
234- - run: composer test:without-coverage
235- if: ${{ matrix.coverage != 'xdebug' }}
234+ - run: composer audit
236235` ` `
237-
238236</details>
239237
240238# # Credits
0 commit comments