Skip to main content
These CI Workflows are no longer maintained
In light of challenges with the GitHub Platform, Encore Digital Group no longer actively uses GitHub beyond mirroring some of our open source repositories. As a result, these CI Workflows are no longer maintained and may no longer function as expected or at all. CI Workflow documentation remains available as a reference but use of these workflows in a production capacity is not advised.

PHP Test PHPUnit Workflow v3 Upgrade Guide

Overview

The php_test_phpunit.yml workflow has been removed in v3. Projects using PHPUnit should migrate to the consolidated php_test.yml workflow.

Breaking Changes

Workflow Removal

The dedicated PHPUnit workflow (php_test_phpunit.yml) has been completely removed in v3. All PHP testing is now handled by the unified php_test.yml workflow.

Migration Steps

1. Update Workflow References

Before (v2):

uses: ./.github/workflows/php_test_phpunit.yml
with:
phpVersion: '8.3'

After (v3):

uses: ./.github/workflows/php_test.yml
with:
phpVersion: '8.3'

2. Create Composer Test Script

The new unified workflow uses composer run test instead of directly calling PHPUnit. You must add a test script to your composer.json:

{
"scripts": {
"test": "phpunit"
}
}

For projects that need coverage reporting with CodeCov, use:

{
"scripts": {
"test": "phpunit --coverage-clover coverage.xml --log-junit junit.xml"
}
}

3. Configure PHPUnit Options

Since the workflow no longer directly calls PHPUnit with specific flags, configure your testing options via composer script flags:

Composer Script with Flags

{
"scripts": {
"test": "phpunit --coverage-clover coverage.xml --log-junit junit.xml --testdox"
}
}

4. CodeCov Integration Added

You now have the option to send your test results to Sentry CodeCov. To do so, ensure the useCodeCov parameter is set to true.

uses: ./.github/workflows/php_test.yml
with:
useCodeCov: true
codeCovSlug: your-org/your-repo
secrets:
codeCovToken: ${{ secrets.CODECOV_TOKEN }}

Key Differences

Featurephp_test_phpunit.yml (v2)php_test.yml (v3)
Test Command./vendor/bin/phpunitcomposer run test
ConfigurationWorkflow parametersComposer scripts + PHPUnit config
CodeCovNot supportedConditional support via useCodeCov
FlexibilityLimitedHigh (via composer scripts)

Migration Checklist

  • Replace workflow references from php_test_phpunit.yml to php_test.yml
  • Add test script to composer.json with appropriate PHPUnit command
  • Configure PHPUnit options via phpunit.xml or composer script flags
  • If using CodeCov, set useCodeCov: true and provide required secrets
  • Test the updated workflow to ensure PHPUnit runs correctly
  • Verify coverage and test result uploads work (if using CodeCov)

Benefits of Migration

  1. Unified Testing: Single workflow for all PHP testing frameworks
  2. Project-specific Configuration: Use composer scripts for custom test commands
  3. Better Flexibility: Configure testing behavior at the project level
  4. CodeCov Integration: Optional but integrated coverage reporting
  5. Reduced Maintenance: Fewer workflow files to maintain