Skip to content

Replace Travis with GitHub Actions + Codecov + Scrutinizer (roadmap #2)#13

Merged
mmucklo merged 2 commits into
masterfrom
add-github-actions-ci
Apr 13, 2026
Merged

Replace Travis with GitHub Actions + Codecov + Scrutinizer (roadmap #2)#13
mmucklo merged 2 commits into
masterfrom
add-github-actions-ci

Conversation

@mmucklo

@mmucklo mmucklo commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Addresses ROADMAP.md item #2. Stacked on top of #12.

Changes

  • Delete .travis.yml (broken — still pinned to PHP 5.3/5.4 and the pre-PSR-4 test layout).
  • Add .github/workflows/ci.yml:
    • Runs on push to master and on every PR.
    • Matrix: PHP 8.1 / 8.2 / 8.3 / 8.4 with `fail-fast: false`.
    • `shivammathur/setup-php@v2` with xdebug for coverage.
    • Composer cache via `actions/cache@v4`.
    • `composer validate --strict` before install.
    • `vendor/bin/phpunit --coverage-clover=coverage.clover`.
    • Coverage upload to Codecov (PHP 8.3 leg) via `codecov/codecov-action@v4`.
    • Coverage upload to Scrutinizer (PHP 8.3 leg) via `ocular.phar` — `continue-on-error` so a Scrutinizer outage doesn't fail the build.
  • Add .scrutinizer.yml with `php-scrutinizer-run` + `phpcs-run` analysis and `external_code_coverage` hooked up.
  • Update README.md with CI, Codecov, and Scrutinizer badges.

Setup needed (out-of-repo, one-time)

  • Register the repo with Codecov and add `CODECOV_TOKEN` as a repo secret (optional for public repos but recommended by the v4 action).
  • Register the repo with Scrutinizer CI.

Test plan

  • Workflow YAML validates (`python3 -c "import yaml; yaml.safe_load(...)"`).
  • Confirm PR workflow runs green on PHP 8.1–8.4 once merged into `modernize-php-baseline`.
  • Confirm Codecov and Scrutinizer accept the first upload after repo registration.

🤖 Generated with Claude Code

mmucklo and others added 2 commits April 12, 2026 14:42
Roadmap item #1.

- composer.json: require PHP >= 8.1, require-dev phpunit/phpunit ^10.5,
  switch autoload from PSR-0 to PSR-4, add PSR-4 autoload-dev mapping
  for tests.
- Relocate src/Inflect/Inflect.php to src/Inflect.php to conform to
  PSR-4 (namespace Inflect, class Inflect).
- Rewrite phpunit.xml.dist against the PHPUnit 10 schema (new <source>
  element, Composer autoload bootstrap, failOnWarning/failOnNotice).
  Rename phpunit.xml-dist -> phpunit.xml.dist per PHPUnit 10 conventions.
- Port tests to namespaced PHPUnit\Framework\TestCase with strict types,
  #[DataProvider] attributes, and assertSame. Tests now live in the
  Inflect\Tests namespace.
- Drop autoload.php.dist (obsoleted by Composer PSR-4 autoload + the
  PHPUnit 10 bootstrap pointing at vendor/autoload.php).
- Ignore .phpunit.result.cache and .phpunit.cache/.

Note: .travis.yml still references PHP 5.3/5.4 and will fail until the
CI modernization (roadmap item #2) replaces it with GitHub Actions.

Verified: 109 tests / 109 assertions pass on PHP 8.1 and 8.3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Roadmap item #2.

- Delete .travis.yml (pinned to PHP 5.3/5.4 and the pre-PSR-4 test layout).
- Add .github/workflows/ci.yml running a matrix of PHP 8.1/8.2/8.3/8.4
  on every push to master and every pull request. Runs composer validate,
  installs dependencies with Composer cache, and executes PHPUnit with
  Clover coverage.
- Upload coverage to Codecov (PHP 8.3 matrix leg) via codecov-action@v4.
- Upload coverage to Scrutinizer (PHP 8.3 matrix leg) via ocular.phar;
  marked continue-on-error so a Scrutinizer outage does not fail the build.
- Add .scrutinizer.yml with php-scrutinizer-run + phpcs-run analysis and
  external_code_coverage wired up.
- Add CI, Codecov, and Scrutinizer badges to README.md.

Stacked on top of the roadmap #1 PHP baseline modernization — this PR
targets the modernize-php-baseline branch and should merge after #12.

Codecov and Scrutinizer need repo registration; Codecov also needs
CODECOV_TOKEN as a repo secret (optional for public repos but recommended
by the action).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Base automatically changed from modernize-php-baseline to master April 13, 2026 01:47
@mmucklo mmucklo merged commit 7c02a78 into master Apr 13, 2026
4 of 5 checks passed
@mmucklo mmucklo deleted the add-github-actions-ci branch April 13, 2026 01:48
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.

1 participant