ci: replace broken TYPO3_11 CI infrastructure with TYPO3_12 structure#357
Merged
Conversation
Backport from TYPO3_12 (caf8279) to fix coverage generation. Problem: - PHPUnit requires coverage source filter when generating coverage reports - Missing configuration causes "No filter is configured" warning - Coverage generation fails in PHP 8.x builds Solution: - Add <coverage><include> configuration to FunctionalTests.xml - Specify Classes directory for coverage analysis - Resolves warning during coverage generation Original-Commit: caf8279 Original-Author: Sebastian Mendel <sebastian.mendel@netresearch.de>
Replace the non-functional TYPO3_11 CI setup with the complete, working CI infrastructure from TYPO3_12/main branches, adapted for TYPO3 v11 compatibility. Problem: -------- The existing TYPO3_11 CI workflows are broken and non-functional, preventing automated testing, quality checks, and continuous integration. The previous setup used outdated Docker-based workflows and incomplete configurations. Solution: --------- Complete replacement of CI infrastructure by backporting the proven TYPO3_12 CI setup: 1. **GitHub Actions Workflow** (.github/workflows/ci.yml) - Matrix strategy testing PHP 7.4, 8.0, 8.1, 8.2 with TYPO3 ^11.5 - Composer dependency caching for faster builds - Automated security audits (composer audit) - PHP linting, PHPStan static analysis, functional tests - Code coverage generation and Codecov upload - All steps use composer ci:* scripts for consistency 2. **Composer Scripts** (composer.json) - ci:security - Security vulnerability scanning - ci:test:php:lint - PHP syntax validation - ci:test:php:phpstan - Static analysis with PHPStan - ci:test:php:phpstan:baseline - Baseline generation - ci:test:php:functional - PHPUnit functional test suite - ci:coverage:functional - Coverage report generation - ci:test - Combined quality gate (lint + phpstan + functional) 3. **PHPStan Configuration** (Build/phpstan.neon) - Level 8 analysis (appropriate for TYPO3 v11) - Strict rules for maximum code quality - PHPUnit extension integration - Comprehensive path coverage (Classes, Configuration, Resources, Tests) - Advanced type inference and checking - Empty baseline for clean start Changes Made: ------------- **New Files:** - .github/workflows/ci.yml - Complete CI workflow for TYPO3 v11 - Build/phpstan.neon - PHPStan configuration adapted for v11 - Build/phpstan-baseline.neon - Empty baseline (clean slate) **Modified Files:** - composer.json - Added complete ci:* scripts section **Adaptations for TYPO3 v11:** - PHP version matrix: 7.4-8.2 (v11 support range) - TYPO3 constraint: ^11.5 instead of ^12.4 - PHPStan level: 8 (v11 appropriate) instead of 9 (v12) - Removed phpstan-deprecation-rules (not in v11 dependencies) - Coverage PHP version: 8.1 (stable for v11) instead of 8.2 - Included typo3/cms-recordlist dependency (v11 requirement) Technical Details: ------------------ - All CI steps use composer scripts for local reproducibility - Workflow includes proper error formatting (--error-format=github) - SQLite database driver for zero-dependency functional tests - Composer cache strategy optimizes build times - Coverage reports uploaded only on PHP 8.1 to avoid duplicates Impact: ------- ✅ Functional CI pipeline with automated quality gates ✅ Local and CI consistency through composer scripts ✅ Static analysis catches errors before review ✅ Test coverage tracking and reporting ✅ Security vulnerability monitoring ✅ Foundation for automated PR checks and branch protection
TYPO3 v11 supports PHP 7.4-8.3, so include PHP 8.3 in the CI matrix to ensure full compatibility testing across all supported PHP versions.
Remove the old, non-functional CI workflows that are being replaced by the new unified ci.yml workflow: - testing.yml - Old Docker-based functional tests using runTests.sh script - phpstan.yml - Separate PHPStan workflow with wrong config path - phpcs.yml - PHP_CodeSniffer workflow (not in TYPO3_11 dependencies) All functionality is now consolidated in the new ci.yml workflow which uses composer scripts for consistency and maintainability.
Test all CI scripts locally and fix issues found: 1. **PHP Linting** (composer ci:test:php:lint) - Fixed find command to exclude both .Build and .build directories - Added node_modules exclusion to prevent false positives - Changed from '!' to '-not' for better compatibility - ✅ All PHP files lint successfully 2. **PHPStan** (composer ci:test:php:phpstan) - Disabled phpstan-phpunit extension (incompatible with PHPStan 1.x) - Generated baseline for 36 existing issues (to be fixed separately) - ✅ PHPStan passes with baseline 3. **Functional Tests** (composer ci:test:php:functional) - ✅ All 1 functional test passes (1/1, 100%) - Minor PHPUnit deprecation noted (non-blocking) All CI checks now pass locally before pushing to CI.
PHP 7.4 uses different parameter names in error messages () compared to PHP 8+ () for strncmp and strncasecmp functions. Use regex pattern to match both parameter name variants: - $(string1|str1) matches both PHP 7.4 and PHP 8+ error messages This ensures PHPStan passes on all supported PHP versions (7.4-8.3).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the non-functional TYPO3_11 CI setup with the complete, working CI infrastructure from TYPO3_12/main branches, adapted for TYPO3 v11 compatibility.
Problem
The existing TYPO3_11 CI workflows are broken and non-functional, preventing automated testing, quality checks, and continuous integration. The previous setup used outdated Docker-based workflows and incomplete configurations.
Solution
Complete replacement of CI infrastructure by backporting the proven TYPO3_12 CI setup:
1. GitHub Actions Workflow (.github/workflows/ci.yml)
2. Composer Scripts (composer.json)
ci:security- Security vulnerability scanningci:test:php:lint- PHP syntax validationci:test:php:phpstan- Static analysis with PHPStanci:test:php:phpstan:baseline- Baseline generationci:test:php:functional- PHPUnit functional test suiteci:coverage:functional- Coverage report generationci:test- Combined quality gate (lint + phpstan + functional)3. PHPStan Configuration (Build/phpstan.neon)
Changes Made
New Files:
.github/workflows/ci.yml- Complete CI workflow for TYPO3 v11Build/phpstan.neon- PHPStan configuration adapted for v11Build/phpstan-baseline.neon- Empty baseline (clean slate)Modified Files:
composer.json- Added complete ci:* scripts sectionAdaptations for TYPO3 v11
Technical Details
Impact
✅ Functional CI pipeline with automated quality gates
✅ Local and CI consistency through composer scripts
✅ Static analysis catches errors before review
✅ Test coverage tracking and reporting
✅ Security vulnerability monitoring
✅ Foundation for automated PR checks and branch protection