Skip to content

Replace Makefile with Castor task runner#64

Merged
damienalexandre merged 11 commits intomainfrom
copilot/replace-makefile-with-castor
Feb 17, 2026
Merged

Replace Makefile with Castor task runner#64
damienalexandre merged 11 commits intomainfrom
copilot/replace-makefile-with-castor

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

Replace Makefile with Castor ✅

  • Understand current Makefile tasks and usage
  • Create castor.php with equivalent tasks
    • cs: Fix PHP CS (with optional --dry-run flag)
    • test: Run the test suite
    • phpstan: Run static analysis
  • Update .gitignore to exclude Castor binary and stub file
  • Update CONTRIBUTING.md to use Castor commands
  • Add Development section to README.md with Castor installation and usage
  • Update CHANGELOG.md with this change
  • Remove Makefile
  • Address PR feedback - simplify installation docs
  • Exclude castor.php from PHPStan analysis
  • Update GitHub Actions to use Castor for CS and PHPStan checks
  • Fix GitHub Actions to use correct setup-castor version
  • Refactor cs task to use --dry-run option
  • Fix coding standards
  • Run code review and security checks

Summary

Successfully replaced the Makefile with Castor task runner. All existing Make tasks have been converted to Castor tasks maintaining the same functionality:

  • make cscastor cs
  • make cs_dry_runcastor cs --dry-run
  • make testcastor test
  • make phpstancastor phpstan

The cs task now accepts a --dry-run option to check coding standards without fixing them, avoiding code duplication.

Documentation links to official Castor installation guide. The castor.php file is excluded from PHPStan analysis as it's a build/developer tool file.

GitHub Actions CI workflows use Castor via the castor-php/setup-castor@v1.0.0 action for CS and PHPStan checks, replacing the previous Docker-based actions.

Original prompt

This section details on the original issue you should resolve

<issue_title>Replace the Makefile with Castor</issue_title>
<issue_description>We want to remove the dependency on Make for this project and use Castor instead: https://castor.jolicode.com/

  • replace the make task by tasks in a castor.php file
  • update the documentation, including the castor dependency
  • update the changelog
    </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@damienalexandre
Copy link
Member

Hey do NOT Add Castor as a dev dependency in composer.json ! That's a developer tool.

Co-authored-by: damienalexandre <225704+damienalexandre@users.noreply.github.com>
Co-authored-by: damienalexandre <225704+damienalexandre@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace Makefile with Castor for dependency management Replace Makefile with Castor task runner Feb 17, 2026
@damienalexandre
Copy link
Member

@copilot add castor.php to the PHPStan ignored list

Co-authored-by: pyrech <2021641+pyrech@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

Hey do NOT Add Castor as a dev dependency in composer.json ! That's a developer tool.

Confirmed - Castor is not in composer.json. It's documented as a standalone PHAR tool that developers install separately.

Co-authored-by: damienalexandre <225704+damienalexandre@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

@copilot add castor.php to the PHPStan ignored list

Done in 015b4f8. Added castor.php to the excludePaths in phpstan.neon.

@joelwurtz
Copy link
Member

@copilot use castor in the github action to the cs fixer and phpstan, you can use the "castor-php/setup-php" marketplace action to install castor

Co-authored-by: joelwurtz <90466+joelwurtz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

@copilot use castor in the github action to the cs fixer and phpstan, you can use the "castor-php/setup-php" marketplace action to install castor

Done in 7d665db. Updated the check-cs and phpstan jobs to use the castor-php/setup-castor@v1 action and run castor cs:dry-run and castor phpstan respectively.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/castor-php/setup-castor/releases/latest
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@damienalexandre
Copy link
Member

Would have been so much cheaper and faster to do this by hand omg.

Error: Unable to resolve action castor-php/setup-castor@v1, unable to find version v1

@copilot you need to read the documentation : https://castor.jolicode.com/installation/github-action/

Co-authored-by: damienalexandre <225704+damienalexandre@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

Would have been so much cheaper and faster to do this by hand omg.

Error: Unable to resolve action castor-php/setup-castor@v1, unable to find version v1
...

Fixed in 872b0bf. Updated to use castor-php/setup-castor@v0.1.0 instead of @v1.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • castor.jolicode.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • https://api.github.com/repos/castor-php/setup-castor
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/repos/castor-php/setup-castor/git/refs/heads
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/repos/castor-php/setup-castor/releases
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/repos/castor-php/setup-castor/tags
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)
  • https://api.github.com/search/code
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@damienalexandre damienalexandre marked this pull request as ready for review February 17, 2026 14:41
Co-authored-by: Jorick <48644518+JorickPepin@users.noreply.github.com>
Co-authored-by: Loïck Piera <pyrech@gmail.com>
Co-authored-by: damienalexandre <225704+damienalexandre@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/search/code
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@damienalexandre
Copy link
Member

@copilot fix the CS

Co-authored-by: damienalexandre <225704+damienalexandre@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 17, 2026

@copilot fix the CS

Fixed in 6286f86. Removed trailing whitespace from castor.php to comply with coding standards.

@damienalexandre damienalexandre merged commit e752707 into main Feb 17, 2026
17 checks passed
@damienalexandre damienalexandre deleted the copilot/replace-makefile-with-castor branch February 17, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the Makefile with Castor

5 participants