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
src
andtests
directories - Run PHP Unit
The Release job runs on the master
branch, only if the Test job runs successfully, and it will:
- Run
semantic-release
to handle the release process
This boilerplate assumes a few things:
- The
phpcs
package is installed in the project:composer require --dev "squizlabs/php_codesniffer=*"
. Our recommended PHP CS configuration can be found here. - The
phpunit
package is installed in the project:composer require --dev phpunit/phpunit
- The project uses
semantic-release
for the release project. It usesnpx
, so you don't have to install anything into the project. You can use a.releaserc
file in the root of the project to configuresemantic-release
.