lts/php-qa-ci

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

Installs: 3 010

Dependents: 4

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 1

Language:Shell

Type:composer-plugin

pkg:composer/lts/php-qa-ci

dev-php8.4 2025-11-07 17:53 UTC

This package is auto-updated.

Last update: 2025-11-07 17:56:26 UTC


README

Install

The qa script will be installed in your project's bin directory. By default, Composer uses vendor/bin, but you can configure a custom location in your composer.json:

  "config": {
    "bin-dir": "bin",  // Optional: changes from vendor/bin to bin

Then install the current bleeding edge, run

composer require --dev lts/php-qa-ci:dev-master@dev

For Symfony - you can accept the prompts to run recipes, but you will then need to decide to either stick with Symfony defaults or the php-qa-ci default which are more extensive

If you decide to stick with the lts defaults, then you should remove the config files that the symfony recipe created. If you want to keep config files in your root directory, you can choose to symlink them to the php-qa-ci files, eg

Note that you should properly compare the files before doing this.

# revert to php-qa-ci PHPUnit configs
rm phpunit.xml.dist
ln -s vendor/lts/php-qa-ci/configDefaults/generic/phpunit.xml 

Introduction

PHP-QA-CI is a quality assurance and continuous integration pipeline written in BASH that can be run both on the desktop as part of your development process and then also as part of a continuous integration (CI) pipeline.

It runs tools in a logical order and will fail as quickly as possible.

This package is written for and has only been tested on Linux.

Quick Setup Scripts

PHP-QA-CI includes convenient scripts for setting up continuous integration and branch protection:

GitHub Actions Setup

Automatically install GitHub Actions workflow for continuous integration:

# Run from your project root
vendor/lts/php-qa-ci/scripts/install-github-actions.bash

This script will:

  • Create .github/workflows/qa.yml with optimized QA pipeline
  • Auto-detect your PHP version from composer.json
  • Configure smart caching for faster builds
  • Set up artifact storage for test results

After installation, the QA pipeline will run automatically on all pushes and pull requests.

Branch Protection Setup

Configure GitHub branch protection rules with sensible defaults:

# Standard protection (admins can bypass)
vendor/lts/php-qa-ci/scripts/setup-branch-protection.bash

# Hardened protection (CI enforced for everyone)
vendor/lts/php-qa-ci/scripts/setup-branch-protection.bash --harden

The script configures:

  • Required CI checks (PHP QA Pipeline must pass)
  • PR review requirements
  • Protection against force pushes and deletions
  • Auto-delete merged branches
  • Conversation resolution requirements

Prerequisites: Requires GitHub CLI (gh) installed and authenticated.

Docs

Comprehensive documentation is available in the ./docs folder:

Other notes

Specify PHP Binary Path

if you are running multiple PHP versions, you can specify which one to use like so:

# If using default vendor/bin location:
export PHP_QA_CI_PHP_EXECUTABLE=/bin/php81
vendor/bin/qa

# Or inline:
PHP_QA_CI_PHP_EXECUTABLE=/bin/php81 vendor/bin/qa

# If you configured "bin-dir": "bin" in composer.json:
PHP_QA_CI_PHP_EXECUTABLE=/bin/php81 bin/qa

Long Term Support

This package was brought to you by Long Term Support LTD, a company run and founded by Joseph Edmonds

You can get in touch with Joseph at https://joseph.edmonds.contact/

Check out Joseph's recent book The Art of Modern PHP 8