From 7ceb9528cc57e36156bc29c2ec9bb1e25fcf3090 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 25 May 2026 23:08:33 -0500 Subject: [PATCH] fix(ci): enforce PHPStan + PHPUnit in CI gates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PHPStan: remove continue-on-error, update label to Level 6, add --memory-limit=512M, fail on errors (was advisory) - PHPUnit: add error handling — tests now block merges on failure (was silently passing even on test failures) Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- .mokogitea/workflows/ci-platform.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.mokogitea/workflows/ci-platform.yml b/.mokogitea/workflows/ci-platform.yml index 47e3ead..1585aa4 100644 --- a/.mokogitea/workflows/ci-platform.yml +++ b/.mokogitea/workflows/ci-platform.yml @@ -124,16 +124,16 @@ jobs: echo "### PHPCS" >> $GITHUB_STEP_SUMMARY echo "PSR-12 compliance: passed" >> $GITHUB_STEP_SUMMARY - - name: "PHPStan (Level 2)" - continue-on-error: true + - name: "PHPStan (Level 6)" run: | - vendor/bin/phpstan analyse -c phpstan.neon --no-progress --error-format=github 2>&1 || { - echo "::warning::PHPStan found type errors (advisory)" + vendor/bin/phpstan analyse -c phpstan.neon --no-progress --memory-limit=512M --error-format=github 2>&1 || { + echo "::error::PHPStan found type errors" echo "### PHPStan" >> $GITHUB_STEP_SUMMARY echo "Static analysis errors detected. Run \`composer phpstan\` locally." >> $GITHUB_STEP_SUMMARY + exit 1 } echo "### PHPStan" >> $GITHUB_STEP_SUMMARY - echo "Static analysis: advisory (level 0)" >> $GITHUB_STEP_SUMMARY + echo "Static analysis (level 6): passed" >> $GITHUB_STEP_SUMMARY - name: "Psalm" continue-on-error: true @@ -177,11 +177,14 @@ jobs: - name: "PHPUnit (PHP ${{ matrix.php }})" run: | - vendor/bin/phpunit --testdox 2>&1 - { - echo "### PHPUnit (PHP ${{ matrix.php }})" - echo "All tests passed." - } >> $GITHUB_STEP_SUMMARY + vendor/bin/phpunit --testdox 2>&1 || { + echo "::error::PHPUnit tests failed" + echo "### PHPUnit (PHP ${{ matrix.php }})" >> $GITHUB_STEP_SUMMARY + echo "Tests failed. Run \`vendor/bin/phpunit --testdox\` locally." >> $GITHUB_STEP_SUMMARY + exit 1 + } + echo "### PHPUnit (PHP ${{ matrix.php }})" >> $GITHUB_STEP_SUMMARY + echo "All tests passed." >> $GITHUB_STEP_SUMMARY # ═══════════════════════════════════════════════════════════════════════ # Gate 3 — Self-Health (Dogfood)