A Composer plugin that sets up CI/CD pipelines for Pantheon projects with CircleCI, including visual regression testing and automated deployments.
- 🚀 Automated Deployments - Push to deploy to Pantheon multidev environments
- 👁️ Visual Regression Testing - Catch visual bugs with Playwright
- 🔗 GitHub Integration - PR status checks and comments
- 🧹 Automated Cleanup - Remove stale multidev environments
- 🛠️ Zero Configuration - Works out of the box with sensible defaults
- Allow the plugin to run:
composer config allow-plugins.helloworlddevs/pantheon-ci-tools true- Add the package to your project:
composer require --dev helloworlddevs/pantheon-ci-tools- Create a
test_routes.jsonfile in your project root with the paths you want to test:
{
"home": "/",
"about": "/about",
"contact": "/contact"
}- The test runner will automatically find this file in your project root or any parent directory (up to 4 levels up).
- Run tests:
./ci/test/visual-regression/run-playwrightCustomize visual testing in playwright.config.js:
- Adjust viewport sizes
- Set thresholds for pixel differences
- Configure test timeouts
The plugin sets up a CircleCI pipeline that:
- Runs on every PR
- Deploys to a multidev environment
- Runs visual regression tests
- Reports results back to GitHub
Set these in your CI environment:
# Required
PANTHEON_SITE=your-site-name
TERMINUS_TOKEN=your-terminus-token
GITHUB_TOKEN=your-github-token- Check the test artifacts for screenshots of failures
- Adjust thresholds in
playwright.config.jsif needed - Update baseline images if the changes are intentional:
UPDATE_SNAPSHOTS=true npx playwright test
- Verify your Terminus token has the correct permissions
- Check the CircleCI logs for detailed error messages
- Ensure your Pantheon site is properly connected to your GitHub repository
MIT
To update the CI configuration, simply update the package:
composer update helloworlddevs/pantheon-ci- Clone the repository
- Run
composer installto install dependencies - Make your changes to the source code
To test your local changes without publishing to Github:
Run the built-in test that uses your local code directly:
php test_local_installer.phpThis will:
- Create a
sampleoutput/directory with a mock Drupal project - Copy
lando-test.ymlas the sample.lando.ymlfile - Run your local installer code directly (not via Composer)
- Show detailed analysis of what was added/modified
- Install all CI files, Lando scripts, and modify
.lando.yml
Check the results in sampleoutput/ to verify everything works correctly.
- In your test Drupal project, add this to
composer.json:
{
"repositories": [
{
"type": "path",
"url": "/path/to/your/pantheon-ci-tools"
}
],
"require-dev": {
"helloworlddevs/pantheon-ci-tools": "@dev"
}
}- Allow the plugin and install:
composer config allow-plugins.helloworlddevs/pantheon-ci-tools true
composer installThe installer will:
- Copy CI configuration files (
.circleci/,.ci/,.github/) - Install Lando scripts (
lando/scripts/dev-config.sh,config-safety-check.sh) - Add tooling commands to
.lando.yml(dev-config,config-check,safe-export) - Add post-start and post-pull events to
.lando.yml - Add
drupal/config_splittorequire-dev
rm -rf sampleoutput # Remove test directoryMIT