From 01012fccbd9f36782a5e6c86f5c73af8d28435cd Mon Sep 17 00:00:00 2001 From: Gerard Oosterhof Date: Tue, 14 Jul 2026 09:49:13 +0200 Subject: [PATCH] ci: add coverage --min=95 gate with pcov driver Adds a CI-time coverage floor to a published library that previously ran coverage: none. Measured coverage is 95.5% (67 tests); floor set at the measured value rounded down to a clean integer. - setup-php coverage: none -> pcov (fast driver, both PHP 8.4 + 8.5 legs) - new composer test:coverage script = pest --coverage --min=95 (teeth are the --min CLI flag, not a XML block, which is a silent no-op on PHPUnit 10+) - CI Tests step now runs composer test:coverage; plain composer test stays for fast local runs without a coverage driver Teeth proven by exit code: --min=95 -> exit 0 (green), --min=96 -> exit 1. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01EmzU5UEBBVH4K691qiuxCh --- .github/workflows/ci.yml | 4 ++-- composer.json | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7680718..4a9b836 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: uses: shivammathur/setup-php@728c6c6b8cf02c2e48117716a91ee48313958a19 # v2 with: php-version: ${{ matrix.php }} - coverage: none + coverage: pcov tools: composer:v2 - name: Install dependencies @@ -36,7 +36,7 @@ jobs: run: composer phpstan - name: Tests - run: composer test + run: composer test:coverage # Aggregate tracked by the town-crier trial (TC-0069), intended as the single # required check (the matrix legs stop being individually required). diff --git a/composer.json b/composer.json index dc0a414..51f90dc 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,7 @@ }, "scripts": { "test": "pest", + "test:coverage": "pest --coverage --min=95", "phpstan": "phpstan analyse", "format": "pint", "format:check": "pint --test"