Migrate CI/CD from Travis/GitLab to GitHub Actions#12
Draft
Migrate CI/CD from Travis/GitLab to GitHub Actions#12
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymland.gitlab-ci.ymlwith.github/workflows/ci.ymlfor GitHub ActionsDeployment Automation: Added
.github/workflows/deploy.ymlfor automated WordPress.org plugin deployment on tag pushes using the 10up actionBuild Tool Migration: Replaced Grunt-based build system with Composer
Gruntfile.jsandpackage.jsoncomposer.jsonwith dev dependencies: phpunit-polyfills, WPCS 3.0, and phpcompatibilityConfiguration Updates:
.phpcs.xml.disttophpcs.xml.gitignoreto exclude/vendorinstead ofnode_modules/bin/rsync-excludes.txtwith.distignorefor cleaner distribution packaging.github/dependabot.ymlfor automated GitHub Actions dependency updatesDocumentation: Updated
AGENTS.mdto reflect new Composer-based development workflow and GitHub Actions CI matrixImplementation Details
shivammathur/setup-php@v2for PHP environment setup with MySQL 8.0 serviceneeds: phpcs)https://claude.ai/code/session_01DsKtS4DCziRAreRFuVrkr5