CI for PHP
Build, lint and test a PHP application using Composer, PHP's built-in linter, and PHPUnit.
Use template →1steps:
2 - label: ":composer: Install packages"
3 key: "composer"
4 command: "composer install"
5 plugins:
6 - docker#v5.9.0:
7 image: "composer:latest"
8 - artifacts#v1.9.3:
9 upload: "vendor"
10 compressed: vendor.tgz
11
12 - label: ":php: Lint"
13 depends_on: "composer"
14 command: 'find -name "*.php" -not -path "./vendor/*" | xargs php -l'
15 plugins:
16 - docker#v5.9.0:
17 image: "php:8.3"
18 - artifacts#v1.9.3:
19 download: "vendor"
20 compressed: vendor.tgz
21
22 - label: ":phpunit: Run phpunit"
23 depends_on: "composer"
24 command: "vendor/bin/phpunit --configuration phpunit.xml"
25 plugins:
26 - docker#v5.9.0:
27 image: "php:8.3"
28 - artifacts#v1.9.3:
29 download: "vendor"
30 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.