Boilerplate workflow for a PHP package.
This is a workflow with two jobs:
- Test
- Release
The Test job runs on every push and will:
- Install composer dependencies
- Run PHP CS on the
srcandtestsdirectories - Run PHP Unit
The Release job runs on the master branch, only if the Test job runs successfully, and it will:
- Run
semantic-releaseto handle the release process
This boilerplate assumes a few things:
- The
phpcspackage is installed in the project:composer require --dev "squizlabs/php_codesniffer=*". Our recommended PHP CS configuration can be found here. - The
phpunitpackage is installed in the project:composer require --dev phpunit/phpunit - The project uses
semantic-releasefor the release project. It usesnpx, so you don't have to install anything into the project. You can use a.releasercfile in the root of the project to configuresemantic-release.