Skip to content

Chore: Consolidate CI workflows and harden test infra#241

Merged
loks0n merged 9 commits into0.34.xfrom
chore/ci-consolidation
Apr 24, 2026
Merged

Chore: Consolidate CI workflows and harden test infra#241
loks0n merged 9 commits into0.34.xfrom
chore/ci-consolidation

Conversation

@loks0n
Copy link
Copy Markdown
Contributor

@loks0n loks0n commented Apr 24, 2026

Summary

  • Merge test.yml + lint.yml + bench.yml into a single ci.yml that runs on both pull_request and push (master + *.x), with four parallel jobs: lint, static, tests (matrix: fpm/swoole), bench.
  • Add PHPStan to CI via a new static job (runs on host PHP 8.2 with ext-swoole, composer cache enabled).
  • Replace the fixed sleep 10 readiness gate with real compose healthchecks and docker compose up --wait.
  • Parallelize adapter tests via a fail-fast: false matrix; each job only brings up its own service.
  • Pin composer:2.0composer:2.7 across Dockerfiles and CI so local and CI use the same toolchain.
  • Bump actions/checkout@v3@v4.
  • Move ext-swoole from require to suggest so FPM-only consumers can composer install without --ignore-platform-reqs. composer.lock regenerated.
  • Simplify phpunit.xml (drop the stray <file> entry).
  • .gitignore hygiene (.vscode/, .phpunit.cache/, composer.phar, explicit .phpunit.result.cache).
  • Remove the odd fpm depends_on: swoole coupling in docker-compose.yml.

Test plan

  • docker compose up -d --build --wait fpm swoole — both containers report Healthy locally
  • docker compose exec -T fpm vendor/bin/phpunit — 101/101 passing
  • docker compose exec -T swoole vendor/bin/phpunit — 101/101 passing
  • vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 512M — clean
  • CI: verify all four jobs pass on this PR
  • CI: verify workflow triggers fire on both pull_request and push

🤖 Generated with Claude Code

Merge test/lint/bench workflows into a single ci.yml, add PHPStan to CI,
parallelize adapter tests via matrix, replace fixed sleeps with compose
healthchecks, pin composer image to 2.7, and bump checkout to v4.

Also move ext-swoole to suggest so FPM-only consumers can install without
--ignore-platform-reqs, and simplify phpunit.xml discovery.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This PR consolidates three separate workflow files into a single ci.yml with four parallel jobs, replaces the sleep 10 readiness gate with Docker healthchecks, moves ext-swoole to suggest, removes phpbench in favour of a k6 benchmark, and performs general housekeeping across Dockerfiles, .gitignore, and phpunit.xml.

The infrastructure changes are well-structured, but two action version references in ci.yml need verification before this can land cleanly:

  • All five actions/checkout steps are pinned to @v6, while the PR description states the intent was to bump to @v4.
  • actions/upload-artifact is pinned to @v7; the stable published major is @v4.

Confidence Score: 4/5

Safe to merge once the two action version tags in ci.yml are confirmed or corrected — currently all CI jobs would fail if @v6/@v7 don't resolve.

Two P1 findings in ci.yml (checkout@v6 and upload-artifact@v7) could silently break every job in the new pipeline. Everything else — healthchecks, composer changes, Dockerfile updates, phpunit.xml restructuring — is correct and well done.

.github/workflows/ci.yml — verify actions/checkout and actions/upload-artifact version tags.

Important Files Changed

Filename Overview
.github/workflows/ci.yml New consolidated CI workflow; uses actions/checkout@v6 and upload-artifact@v7 which may not resolve — both are ahead of published stable majors and will break all jobs.
docker-compose.yml Replaces fixed sleep with Docker healthchecks and removes the odd fpm→swoole depends_on; fsockopen timeout issue already flagged in prior review.
composer.json Moves ext-swoole to suggest, pins platform versions, removes phpbench dev-dep, renames scripts — all correct.
phpunit.xml Splits into unit / e2e-fpm / e2e-swoole test suites and drops stray Client.php file entry; clean and correct.
tests/bench/benchmark.js New k6 benchmark script with warmup + load scenarios and p95/p99 thresholds; looks correct.

Reviews (3): Last reviewed commit: "Bump k6 load to 60s, shorten PR comment,..." | Re-trigger Greptile

Comment thread docker-compose.yml
Comment thread docker-compose.yml
Comment thread .github/workflows/ci.yml
loks0n and others added 7 commits April 24, 2026 10:19
Rename jobs per team convention: Lint -> Format, Static Analysis -> Analyze,
Benchmarks -> Benchmark. Split the single Tests matrix into three jobs:
Tests / Unit (runs on host PHP, no docker), Tests / E2E / FPM, and
Tests / E2E / Swoole.

Adds phpunit testsuites (unit, e2e-fpm, e2e-swoole) and moves BaseTest
trait to tests/ so it autoloads via its existing PSR-4 namespace.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The CodeQL workflow did not actually run CodeQL — it ran PHPStan under a
misleading name. Checks / Analyze already covers that.
Removes phpbench/phpbench (and its Symfony transitive deps) in favour of
a k6 HTTP load test targeting the swoole adapter. The CI benchmark job
runs k6 against the docker-compose swoole service, uploads the JSON +
text summary as an artifact, and posts a sticky PR comment with the
default k6 summary output.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

k6 benchmark

Throughput Requests Fail rate p50 p95
7946 req/s 556289 0% 4.72 ms 12.26 ms

Comment thread .github/workflows/ci.yml
Comment on lines +1 to +6
name: CI

on:
pull_request:
push:
branches: [master, "*.x"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security CodeQL security scanning silently removed

codeql-analysis.yml was deleted as part of this PR but is not mentioned in the description. The repository no longer has any automated security scanning for PHP source code. If this is intentional, the PR description should document the decision; if not, the file should be restored or replaced with an equivalent scanning step in ci.yml.

Also updates checkout, cache, upload-artifact, and sticky-comment actions
to their latest major versions.
Comment thread .github/workflows/ci.yml
name: Checks / Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 actions/checkout version mismatch with PR description

The PR description says "Bump actions/checkout@v3@v4", but every uses: actions/checkout step in this file is pinned to @v6. If @v6 does not resolve in the GitHub Actions runner (e.g., it's ahead of what's been released), all five jobs will fail immediately on the checkout step. Verify the intended tag and update consistently.

@loks0n loks0n merged commit 9a28db8 into 0.34.x Apr 24, 2026
7 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.

1 participant