Skip to content

fix(ci): eliminate PHPUnit 12 false-positive coverage warnings #24

fix(ci): eliminate PHPUnit 12 false-positive coverage warnings

fix(ci): eliminate PHPUnit 12 false-positive coverage warnings #24

Workflow file for this run

name: CI
# ARFA 1.3 / KaririCode Spec V4.0 — Unified CI Pipeline
# Runs on every push and PR targeting main or develop.
# Full pipeline: cs-fixer → phpstan (L9) → psalm → phpunit (pcov)
# Zero tolerance: any tool failure blocks the merge.
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
jobs:
quality:
name: Quality Pipeline (ARFA 1.3)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# PHP 8.4 + pcov (mandatory driver per ARFA 1.3 §Testing)
- uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml
coverage: pcov
tools: composer:v2
# Pure dependency install — no scripts to avoid environment pollution
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress --no-scripts
# Bootstrap kcode.phar from the official KaririCode release
- name: Install kcode (KaririCode Devkit)
run: |
wget -q https://github.com/KaririCode-Framework/kariricode-devkit/releases/latest/download/kcode.phar
chmod +x kcode.phar
sudo mv kcode.phar /usr/local/bin/kcode
# Generate .kcode/ configs: phpunit.xml.dist, phpstan.neon, psalm.xml, etc.
- name: Initialize devkit (.kcode/ generation)
run: kcode init
# Patch generated phpunit.xml.dist — beStrictAboutCoverageMetadata causes false
# "not a valid target" warnings for classes extending vendor base classes
- name: Patch phpunit.xml.dist
run: |
sed -i 's/beStrictAboutCoverageMetadata="true"/beStrictAboutCoverageMetadata="false"/' .kcode/phpunit.xml.dist
# cs-fixer → phpstan (L9) → psalm → phpunit
# Exit code ≠ 0 fails the job (zero-tolerance policy)
- name: Run full quality pipeline
run: kcode quality