CI for PHP
Build, lint and test a PHP application using Composer, PHP's built-in linter, and PHPUnit.
Use template →1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
steps: - label: ":composer: Install packages" key: "composer" command: "composer install" plugins: - docker#v5.9.0: image: "composer:latest" - artifacts#v1.9.3: upload: "vendor" compressed: vendor.tgz - label: ":php: Lint" depends_on: "composer" command: 'find -name "*.php" -not -path "./vendor/*" | xargs php -l' plugins: - docker#v5.9.0: image: "php:8.3" - artifacts#v1.9.3: download: "vendor" compressed: vendor.tgz - label: ":phpunit: Run phpunit" depends_on: "composer" command: "vendor/bin/phpunit --configuration phpunit.xml" plugins: - docker#v5.9.0: image: "php:8.3" - artifacts#v1.9.3: download: "vendor" compressed: vendor.tgz
- Languages
- PHP
- Use cases
- Continuous integration
CI for PHP
Build, lint and test a PHP application using Composer, PHP's built-in linter, and PHPUnit.
Use template →CI for PHP
This template gives you a continuous integration (CI) pipeline that builds, lints, and tests a PHP application.
At a glance:
How it works
This template:
- Installs PHP dependencies with Composer
- Lints application PHP code with PHP's built-in linter.
- Runs tests with PHPUnit.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your PHP application.
- Modify the commands if necessary.
- Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.