Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,50 @@

## Usage

### GitHub Actions

For generating PHP version matrix in GitHub Actions, use [PHP Matrix Action](https://github.com/marketplace/actions/php-matrix).

<details>

<summary>Example</summary>

```yml
name: Test

on:
push:

jobs:
php-matrix:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.php-matrix.outputs.versions }}
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: composer.json
sparse-checkout-cone-mode: false

- uses: typisttech/php-matrix-action@v2
id: php-matrix

test:
runs-on: ubuntu-latest
needs: php-matrix
strategy:
matrix:
php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
steps:
- uses: actions/checkout@v5
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- run: composer install
- run: composer test
```
</details>

### List PHP versions that satisfy the required PHP constraint in `composer.json`

```console
Expand Down
Loading