Skip to content

Add the CI workflow - #8

Merged
makriman merged 2 commits into
mainfrom
ci-ready
Dec 5, 2026
Merged

makriman merged 2 commits into
mainfrom
ci-ready

Conversation

@makriman

@makriman makriman commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The repository documents checks that run in CI, but no workflow exists under .github/workflows/, so nothing runs on a push or a pull request. See #6.

Change

  • .github/workflows/ci.yml: jobs checks

Testing

GitHub Actions run 47429673231 on this pull request passed PHP 8.1, PHP 8.2 and PHP 8.3: install, lint, PHP_CodeSniffer, PHPStan, the unit suite (155 tests) and the integration suite against a MySQL 8.0 service (10 tests), on PHP 8.1.34, 8.2.36 and 8.3.37. Locally on PHP 8.3 the lint, PHPCS, PHPStan and unit steps pass; the integration suite was not run locally.

The first run failed only PHP 8.1, at the lint step: four test handlers in tests/Unit/RegistrationTest.php and tests/Unit/RunnerTest.php were declared fn (): null, and a standalone null type is PHP 8.2 syntax, so php -l failed on 8.1, which composer.json supports. They now return ?array. This was a test file defect only; no file under src/ uses 8.2-only syntax, and there is no CHANGELOG entry because the plugin's behaviour is unchanged.

Review notes

  • The token used until now could not write workflow files, which is why this arrives separately from the code fixes.
  • Dependabot's github-actions updates need a workflow to exist, so they start working once this merges.

Fixes #6

@makriman makriman changed the title CI workflow (push needs workflow scope) Add the CI workflow Dec 4, 2026
Four test handlers were declared fn (): null. A standalone null type
is PHP 8.2 syntax, so php -l failed on PHP 8.1, which composer.json
supports, and the 8.1 CI job stopped at the lint step. They now return
?array, which every supported version parses. No source file used it.
@makriman

makriman commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

Review by Grok Bot (Indian Opinion QA agent)

Tested at head 87bf890. Verdict: works.

Fixes: #6. The workflow file is added and its first run on this PR passed.

What I checked

  • Files changed: .github/workflows/ci.yml, tests/Unit/RegistrationTest.php, tests/Unit/RunnerTest.php. Outside .github/ it also changes tests/Unit/RegistrationTest.php, tests/Unit/RunnerTest.php, covered below.
  • actionlint 1.7.12 on the workflow: exit 0, no findings.
  • ci.yml: triggers push, pull_request; token permissions {"contents": "read"}. Services: mysql:8.0.
  • Code change: four test closures change their return type from null to ?array. A standalone null return type only exists from PHP 8.2, so on main these test files don't parse on PHP 8.1. The hosted PHP 8.1 job on this head passes (table below). The tests still check a null return, so they test the same thing.
  • Matrix: php 8.1, php 8.2, php 8.3. composer.json requires PHP >=8.1, so the floor (8.1) is covered.

Hosted run on this PR (GitHub Actions, read from the job logs)

Job Result PHP Test summary
PHP 8.1 success 8.1.34 OK (155 tests, 5311 assertions); OK (10 tests, 78 assertions)
PHP 8.2 success 8.2.36 OK (155 tests, 5311 assertions); OK (10 tests, 78 assertions)
PHP 8.3 success 8.3.37 OK (155 tests, 5311 assertions); OK (10 tests, 78 assertions)

Local run on this box (PHP 8.4.28 / Node 24.22.1), this head vs main

Command This PR main
composer validate --strict valid valid
composer install exit 0 exit 0
locked packages' require.php vs PHP 8.1.0 (repo floor), checked with composer/semver all fit PHP 8.1 all fit PHP 8.1
composer test (or vendor/bin/phpunit) exit 0: Tests: 165, Assertions: 5311, Skipped: 10. exit 0: Tests: 165, Assertions: 5311, Skipped: 10.
composer test with the integration DB env vars set (MariaDB 11.8.9) exit 0: OK (165 tests, 5389 assertions) not run
vendor/bin/phpstan analyse No errors No errors
composer audit --locked No security vulnerability advisories found. No security vulnerability advisories found.
actionlint 1.7.12 exit 0, no findings not run

Review

  • composer.json allows PHP 8.4, but the matrix stops at 8.3. My local run above is on 8.4.28 and passes, so adding '8.4' to the matrix looks safe.
  • The workflow runs composer update, which ignores the committed composer.lock. CI then tests whatever resolves that day, not the locked versions that composer install gives. composer install would test the lock, and would also catch a Dependabot lock bump that doesn't fit an older PHP in the matrix.
  • The hosted PHPUnit jobs report no skipped DB tests, so the DB-backed tests ran against the MySQL service in CI. That covers MySQL 8, which I can't run on this box.

Not tested: I didn't rerun the hosted jobs. The table above is read from this PR's own Actions logs.

I'm Grok Bot, the automated QA agent for Indian Opinion. This is a comment-only review. I don't approve, request changes or merge. Local stack: PHP 8.4.28, Composer 2.11.3, MariaDB 11.8.9, Node 24.22.1, WordPress 7.1.5.

@makriman
makriman marked this pull request as ready for review December 5, 2026 18:35
@makriman
makriman merged commit dadb61f into main Dec 5, 2026
3 checks passed
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.

CI is not active: CONTRIBUTING says CI runs the checks, but the repo has no workflow in .github/workflows

1 participant