GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - typisttech/php-matrix-action: Generate PHP version matrix according to `composer.json`

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
BranchesTags
Open more actions menu

Latest commit

 

History

100 Commits
100 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
testdata
testdata
 
 
.gitattributes
.gitattributes
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
action.yml
action.yml
 
 

Repository files navigation

PHP Matrix Action

GitHub Release GitHub Marketplace Test License Follow @TangRufus on X Follow @TangRufus.com on Bluesky Sponsor @TangRufus via GitHub Hire Typist Tech

Generate PHP version matrix according to composer.json

Built with ♥ by Typist Tech


Tip

Hire Tang Rufus!

I am looking for my next role, freelance or full-time. If you find this tool useful, I can build you more dev tools like this. Let's talk if you are hiring PHP / Ruby / Go developers.

Contact me at https://typist.tech/contact/


Usage

See action.yml and the underlying script typisttech/php-matrix.

  - uses: typisttech/php-matrix-action@73b41f402280305866c655b5a2485d5c9d7a36bc # v4.0.0
    with:
      # Path to composer.json
      #
      # Default: composer.json
      composer-json: some/path/to/composer.json

      # Version format
      #
      # Available modes:
      #   - `minor-only`: Report `MAJOR.MINOR` versions only
      #   - `full`: Report all satisfying versions in `MAJOR.MINOR.PATCH` format
      #
      # Default: minor-only
      mode: full

      # Source of releases information
      #
      # Available sources:
      #   - `auto`: Use `offline` in `minor-only` mode. Otherwise, fetch from [php.net]
      #   - `php.net`: Fetch releases information from [php.net]
      #   - `offline`: Use [hardcoded releases] information
      #
      # [php.net]: https://www.php.net/releases/index.php
      # [hardcoded releases]: https://github.com/typisttech/php-matrix/blob/main/resources/all-versions.json
      #
      # Default: auto
      source: offline

      # PHP Matrix version
      #
      # The version of [php-matrix] to use. Leave blank for latest. For example: v1.0.2
      #
      # [php-matrix]: https://github.com/typisttech/php-matrix
      #
      # Default: ''
      version: v1.0.2

      # Verify Attestation
      #
      # Whether to verify PHP matrix tarball attestation
      #
      # Default: true
      verify-attestation: false

      # Github Token
      #
      # GitHub token to use for authentication
      #
      # Default: ${{ github.token }}
      github-token: ${{ secrets.GITHUB_PAT_TOKEN }}

Outputs

Key Description Example
constraint PHP constraint found in composer.json ^7.3 || ^8.0
versions String of an array of all supported PHP versions In minor-only mode, ["7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]

In full mode, ["7.4.998", "7.4.999", "8.4.998", "8.4.999"]
lowest Lowest supported PHP versions In minor-only mode, 7.3

In full mode, 7.3.0
highest Highest supported PHP versions In minor-only mode, 8.4

In full mode, 8.4.2

Tip

Hire Tang Rufus!

There is no need to understand any of these quirks. Let me handle them for you. I am seeking my next job, freelance or full-time.

If you are hiring PHP / Ruby / Go developers, contact me at https://typist.tech/contact/

Examples

Run tests against all supported PHP versions.
name: Test

on:
  push:

jobs:
  php-matrix:
    runs-on: ubuntu-slim
    outputs:
      versions: ${{ steps.php-matrix.outputs.versions }}
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          sparse-checkout: composer.json
          sparse-checkout-cone-mode: false
          persist-credentials: false

      - id: php-matrix
        uses: typisttech/php-matrix-action@73b41f402280305866c655b5a2485d5c9d7a36bc # v4.0.0


  test:
    needs:
      - php-matrix
    strategy:
      matrix:
        php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }}
    runs-on: ubuntu-26.04
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false
      - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
        with:
          php-version: ${{ matrix.php-version }}
      - run: composer install
      - run: composer test
Run tests on the highest supported PHP version only.
name: Test

on:
  push:

jobs:
  test:
    runs-on: ubuntu-26.04
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false

      - id: php-matrix
        uses: typisttech/php-matrix-action@73b41f402280305866c655b5a2485d5c9d7a36bc # v4.0.0


      - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
        with:
          php-version: ${{ steps.php-matrix.outputs.highest }}

      - run: composer install
      - run: composer test

People Also Use

  • PHP Matrix CLI to generate PHP version matrix according to composer.json
  • Composer Audit to SARIF Action Convert Composer audit reports to SARIF files in GitHub Actions
  • WP Sec Adv Composer repository for WordPress security advisories
  • WP Org Closed Plugin Composer plugin to mark packages as abandoned if closed on WordPress.org
  • comver Work with composer supported versions in Go
  • WPry Parse WordPress plugin and theme headers

Credits

PHP Matrix Action is a Typist Tech project and maintained by Tang Rufus, freelance developer for hire.

Full list of contributors can be found on GitHub.

Copyright and License

This project is a free software distributed under the terms of the MIT license. For the full license, see LICENSE.

Contribute

Feedbacks / bug reports / pull requests are welcome.

About

Generate PHP version matrix according to `composer.json`

Topics

cigithub-actionsphp

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.