Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GitHub Action that gets the PHP versions in range from composer.json

License

NotificationsYou must be signed in to change notification settings

WyriHaximus/github-action-composer-php-versions-in-range

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

Repository files navigation

GitHub Action that gets the PHP versions in range from composer.json

Options

This action supports the following option.

upcomingReleases

Will include the next upcoming major or minor PHP release. For example, if enabled at the time of writing (May 2022)that will be8.2. Note that this version will be updated once the first alpha is out. Looking for more bleedingedge,nightly will hold the same value from the release day of the previousX.Y.0 release.

  • Required:No
  • Type:Boolean
  • Default:false
  • Example:true for including upcoming new major or minor releases

nightly

Will include the nightly of the next new major or minor PHP release. For example, if enabled at the time of writing (December 2023)that will be8.4.

  • Required:No
  • Type:Boolean
  • Default:false
  • Example:true for including the nightly of the next new major or minor releases

workingDirectory

Set a different than the root directory to look forcomposer.json

  • Required:No
  • Type:String
  • Default:""
  • Example:clients/GitHub

Output

The action comes with 7 outputs, most importantlyversion which contains a JSON list with versions to be used infollow up steps:

["7.3","7.4","8.0","8.1","8.2","8.3","8.4"]

And thehighest andlowest outputs that provide the highest PHP version (8.4 in theversion output example)and the lowest PHP version (7.3 in theversion output example) from theversion list. The 4rth output isupcoming and will be populated with the upcoming but in alpha/beta/rc next minor or major version of PHP. Thenightly contains the current in development but not alpha/beta/rc tag next major or minor version.

On top of that this action will also give you 3 lists of extensions. The extensions fromrequire inrequiredExtensions, dev extensions inrequiredDevExtensions, and a combined list inextensions.

Example

This example will get the supported PHP version fromcomposer.json and run tests of all those version:

name:CIon:push:pull_request:jobs:supported-versions-matrix:name:Supported Versions Matrixruns-on:ubuntu-latestoutputs:extensions:${{ steps.supported-versions-matrix.outputs.extensions }}version:${{ steps.supported-versions-matrix.outputs.version }}steps:      -uses:actions/checkout@v3      -id:supported-versions-matrixuses:WyriHaximus/github-action-composer-php-versions-in-range@v1tests:name:PHP ${{ matrix.php }} Latestruns-on:ubuntu-latestneeds:      -supported-versions-matrixstrategy:matrix:php:${{ fromJson(needs.supported-versions-matrix.outputs.version) }}steps:      -name:Checkout codeuses:actions/checkout@v3      -name:Setup PHPuses:shivammathur/setup-php@v2with:php-version:${{ matrix.php }}tools:composercoverage:noneextensions:${{ join(fromJson(needs.supported-versions-matrix.outputs.extensions), ',') }}      -name:Install dependenciesuses:ramsey/composer-install@v2      -name:Execute testsrun:composer test

License

Copyright 2024Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any personobtaining a copy of this software and associated documentationfiles (the "Software"), to deal in the Software withoutrestriction, including without limitation the rights to use,copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the followingconditions:

The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIESOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.

About

GitHub Action that gets the PHP versions in range from composer.json

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp