Skip to content

Conversation

@Spomky
Copy link
Member

@Spomky Spomky commented Jan 3, 2026

Summary

This PR migrates the CI/CD infrastructure to match the otphp project structure, providing better consistency across Spomky-Labs repositories.

Changes

🏗️ Structure

  • Created .ci-tools/ directory for all CI/CD configuration files
  • Moved configuration files (preserving git history with git mv):
    • ecs.php.ci-tools/ecs.php
    • rector.php.ci-tools/rector.php
    • phpstan.neon.ci-tools/phpstan.neon
    • phpstan-baseline.neon.ci-tools/phpstan-baseline.neon
    • phpunit.xml.dist.ci-tools/phpunit.xml.dist
    • infection.json.ci-tools/infection.json.dist
    • deptrac.yaml.ci-tools/deptrac.yaml
    • phpbench.json.ci-tools/phpbench.json

🔧 Configuration Updates

  • Updated all config files to use relative paths (__DIR__ . '/../' pattern)
  • Modernized rector.php to use builder pattern (RectorConfig::configure())
  • Updated phpstan.neon to use %currentWorkingDirectory% variables

🤖 Task Orchestration

  • Created castor.php task orchestrator replacing Makefile
  • Implemented all Makefile tasks as Castor commands
  • Added Docker abstraction via phpqa() function
  • Tasks reference configs with .ci-tools/ prefix

🔄 GitHub Workflows

  • Completely rewrote .github/workflows/integrate.yml to match otphp structure
  • All jobs now use ghcr.io/spomky-labs/phpqa containers
  • Replaced Make commands with Castor commands
  • Merged infection.yml into main integrate.yml workflow
  • Added dependency caching and concurrency controls

📦 Package Distribution

  • Simplified .gitattributes with single /.ci-tools export-ignore
  • Added /castor.php export-ignore
  • Removed individual config file ignores

🗑️ Removed Files

  • Makefile (replaced by castor.php)
  • .github/workflows/infection.yml (merged into integrate.yml)

Benefits

Consistency - Matches otphp and other Spomky-Labs projects
Organization - All CI/CD configs centralized in .ci-tools/
Maintainability - Single source of truth (castor.php)
Docker Integration - Automatic detection and fallback
Clean Distribution - CI tools excluded from packages
Cross-Platform - Castor works everywhere (PHP-based vs Make)

Available Castor Commands

# Code Quality
castor ecs              # Check coding standards
castor ecs-fix          # Fix coding standards
castor rector           # Check refactoring (dry-run)
castor rector-fix       # Apply refactoring
castor phpstan          # Static analysis
castor phpstan-baseline # Generate PHPStan baseline
castor deptrac          # Architecture validation
castor lint             # Syntax check

# Testing
castor phpunit          # Run all tests with coverage
castor unit-tests       # Unit tests only
castor integration-tests # Integration tests only
castor functional-tests # Functional tests only
castor coverage         # HTML coverage report
castor coverage-ci      # Text coverage for CI
castor infect           # Mutation testing (local)
castor infect-ci        # Mutation testing (CI)
castor js               # JavaScript tests

# Utilities
castor check-licenses   # License validation
castor prepare-pr       # Prepare code for PR
castor phpqa-update     # Update PHPQA Docker image

Testing

All Castor commands have been tested locally and work correctly.

Migration Notes

  • Castor is installed globally (not in composer.json)
  • CI uses ghcr.io/spomky-labs/phpqa Docker images
  • All paths in config files adjusted for .ci-tools/ location
  • Git history preserved for all moved files

🤖 Generated with Claude Code

@Spomky Spomky force-pushed the ci-tools-migration branch from b501adc to 06d8330 Compare January 3, 2026 18:23
@Spomky Spomky self-assigned this Jan 3, 2026
@Spomky Spomky added this to the 3.2.0 milestone Jan 3, 2026
@Spomky Spomky force-pushed the ci-tools-migration branch 5 times, most recently from 43ff896 to ed9f54b Compare January 3, 2026 18:39
Spomky and others added 2 commits January 3, 2026 19:41
This migration aligns web-push with the otphp project structure for better
consistency across Spomky-Labs repositories.

Major changes:
- Created `.ci-tools/` directory for all CI/CD configuration files
- Moved and updated config files (ecs.php, rector.php, phpstan.neon, etc.)
- Created `castor.php` task orchestrator replacing Makefile
- Updated GitHub workflows to use Castor commands and phpqa containers
- Simplified `.gitattributes` with single `.ci-tools` export-ignore
- Merged infection.yml into main integrate.yml workflow

Benefits:
- Consistent structure across Spomky-Labs projects
- Centralized CI/CD configuration in `.ci-tools/`
- Docker-based tooling via ghcr.io/spomky-labs/phpqa
- Cleaner package distribution (CI tools excluded)
- Cross-platform task orchestration with Castor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… version in workflows, and add new dependency review and scorecards actions
@Spomky Spomky force-pushed the ci-tools-migration branch from ed9f54b to 7886e49 Compare January 3, 2026 18:43
@Spomky Spomky merged commit 7c1271d into 3.2.x Jan 4, 2026
17 checks passed
@Spomky Spomky deleted the ci-tools-migration branch January 4, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants