Skip to content

Commit 04e0527

Browse files
committed
Update readme
1 parent 2e3e3f9 commit 04e0527

File tree

1 file changed

+38
-41
lines changed

1 file changed

+38
-41
lines changed

README.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -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
116116
name: 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,49 @@ 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
154157
on:
155158
push:
156159
157160
jobs:
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
171-
172-
- run: vendor/bin/phpstan analyse src
174+
- run: composer test
173175
```
174-
175176
</details>
176177

177178
<details>
178-
<summary>Run tests with coverage.</summary>
179+
<summary>Run `$ composer audit` against all supported PHP versions.</summary>
179180

180181
```yaml
181-
name: Test
182+
name: Composer Audit
182183
183184
on:
184185
push:
@@ -189,52 +190,48 @@ jobs:
189190
outputs:
190191
versions: ${{ steps.php-matrix.outputs.versions }}
191192
highest: ${{ steps.php-matrix.outputs.highest }}
193+
lowest: ${{ steps.php-matrix.outputs.lowest }}
192194
steps:
193-
- uses: actions/checkout@v4
195+
- uses: actions/checkout@v5
194196
with:
195197
sparse-checkout: composer.json
196198
sparse-checkout-cone-mode: false
197199
198200
- uses: typisttech/php-matrix-action@v2
199201
id: php-matrix
200202
201-
test:
202-
runs-on: ubuntu-latest
203+
composer-audit:
203204
needs: php-matrix
205+
runs-on: ubuntu-latest
204206
strategy:
205207
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
208+
php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
209+
dependency-versions: [highest]
213210
include:
214-
- php: ${{ needs.php-matrix.outputs.highest }}
215-
dependency-versions: highest
216-
coverage: xdebug
211+
- php-version: ${{ needs.php-matrix.outputs.lowest }}
212+
dependency-versions: lowest
213+
- php-version: ${{ needs.php-matrix.outputs.highest }}
214+
dependency-versions: locked
215+
env:
216+
COMPOSER_NO_AUDIT: 1
217217
steps:
218-
- uses: actions/checkout@v4
218+
- uses: actions/checkout@v5
219+
with:
220+
sparse-checkout: |
221+
composer.json
222+
composer.lock
223+
sparse-checkout-cone-mode: false
219224
220225
- uses: shivammathur/setup-php@v2
221226
with:
222-
php-version: ${{ matrix.php }}
223-
coverage: ${{ matrix.coverage }}
224-
env:
225-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
226-
227+
php-version: ${{ matrix.php-version }}
228+
coverage: none
227229
- uses: ramsey/composer-install@v3
228230
with:
229231
dependency-versions: ${{ matrix.dependency-versions }}
230232
231-
- run: composer test:with-coverage
232-
if: ${{ matrix.coverage == 'xdebug' }}
233-
234-
- run: composer test:without-coverage
235-
if: ${{ matrix.coverage != 'xdebug' }}
233+
- run: composer audit
236234
```
237-
238235
</details>
239236

240237
## Credits

0 commit comments

Comments
 (0)