Skip to content

Migrate CI/CD from Travis/GitLab to GitHub Actions#12

Draft
gagan0123 wants to merge 10 commits intomasterfrom
claude/modernize-cicd-automations-xWGql
Draft

Migrate CI/CD from Travis/GitLab to GitHub Actions#12
gagan0123 wants to merge 10 commits intomasterfrom
claude/modernize-cicd-automations-xWGql

Conversation

@gagan0123
Copy link
Copy Markdown
Owner

This PR modernizes the project's CI/CD infrastructure by migrating from Travis CI and GitLab CI to GitHub Actions, while also updating the development toolchain from Grunt/npm to Composer-based workflows.

Key Changes

  • CI/CD Migration: Replaced .travis.yml and .gitlab-ci.yml with .github/workflows/ci.yml for GitHub Actions

    • PHPCS linting and PHPUnit testing now run on GitHub Actions
    • Updated test matrix to PHP 7.4-8.3 and WordPress 6.0-latest (removed legacy PHP 5.6 and old WordPress versions)
    • Added concurrency controls to cancel in-progress runs on new pushes
    • Nightly WordPress builds continue to allow failures
  • Deployment Automation: Added .github/workflows/deploy.yml for automated WordPress.org plugin deployment on tag pushes using the 10up action

  • Build Tool Migration: Replaced Grunt-based build system with Composer

    • Removed Gruntfile.js and package.json
    • Added composer.json with dev dependencies: phpunit-polyfills, WPCS 3.0, and phpcompatibility
    • Removed npm-based PHPCS and i18n generation in favor of Composer and WP-CLI
  • Configuration Updates:

    • Renamed .phpcs.xml.dist to phpcs.xml
    • Updated .gitignore to exclude /vendor instead of node_modules/
    • Replaced bin/rsync-excludes.txt with .distignore for cleaner distribution packaging
    • Added .github/dependabot.yml for automated GitHub Actions dependency updates
  • Documentation: Updated AGENTS.md to reflect new Composer-based development workflow and GitHub Actions CI matrix

Implementation Details

  • GitHub Actions uses shivammathur/setup-php@v2 for PHP environment setup with MySQL 8.0 service
  • PHPCS runs as a separate job that PHPUnit depends on (needs: phpcs)
  • Test matrix includes both single-site and multisite WordPress configurations
  • Removed manual SVN deployment script in favor of 10up's standardized action

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5

claude added 10 commits April 4, 2026 21:55
Replace legacy CI/CD infrastructure with modern GitHub Actions workflows:

- Add CI workflow with PHPCS linting and PHPUnit matrix (PHP 7.4-8.3 × WP latest/6.5/6.0/nightly)
- Add deploy workflow using 10up/action-wordpress-plugin-deploy for WordPress.org SVN releases
- Add Dependabot config to keep Actions versions current
- Add composer.json with dev dependencies (WPCS, PHPUnit polyfills)
- Add .distignore for WordPress.org deployment exclusions
- Remove Travis CI config (.travis.yml)
- Remove GitLab CI config (.gitlab-ci.yml) and deploy script (bin/gitlab-deploy.sh)
- Remove Grunt build tooling (Gruntfile.js, package.json, package-lock.json)
- Update README.md badges and AGENTS.md documentation

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
- Add /vendor/* exclude-pattern to .phpcs.xml.dist (replaces node_modules)
- Remove stale Gruntfile.js exclusion from PHPCS config
- Update .lando.yml volume exclusion from node_modules to vendor
- Add composer.lock for reproducible CI builds

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
- Use __DIR__ instead of dirname(__FILE__) in tests/bootstrap.php
- Fix closing brace placement in class-shortcode-widget-plugin.php
- Remove extra blank line at end of class-shortcode-widget-plugin.php
- Fix closing brace placement in class-shortcode-widget.php

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
The committed composer.lock was generated on PHP 8.3 and locked
PHPUnit 10.x which requires PHP >= 8.1, breaking PHP 7.4 and 8.0 jobs.

- Remove composer.lock from repo (dev-only deps for a multi-PHP plugin)
- Add composer.lock to .gitignore
- Use composer update in CI so each PHP version resolves compatible deps

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
The install-wp-tests.sh script requires subversion (svn co) and
mysql-client (mysqladmin) which are not available by default on
GitHub Actions runners.

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
…nflict

The MySQL service container was pre-creating the wordpress_test database
via MYSQL_DATABASE env var, causing mysqladmin create in
install-wp-tests.sh to fail (database already exists).

Let the install script handle database creation instead.

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
WordPress 6.0+ test suites require yoast/phpunit-polyfills and look
for the WP_TESTS_PHPUNIT_POLYFILLS_PATH env var to locate them.
The polyfills are installed via composer but the path was not
configured, causing all PHPUnit jobs to fail.

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
Replace assertContains/assertNotContains on string haystacks with
assertStringContainsString/assertStringNotContainsString. The former
were removed for string arguments in PHPUnit 9 (only work with
iterables). The old CI used PHPUnit 5 where these still worked.

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
The yoast/phpunit-polyfills dependency pulls in PHPUnit as a transitive
dep, and on PHP 8.2+ composer resolves to PHPUnit 10/11 which rejects
the phpunit.xml.dist config attributes (convertErrorsToExceptions, etc).

Pin phpunit/phpunit to ^9.6 in composer.json to ensure consistent
version across all PHP versions, remove tools: phpunit:9 from
setup-php, and run vendor/bin/phpunit explicitly.

https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants