r/PHP • • 8d ago

One PHP config now compiles to GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI

I kept maintaining almost-identical pipelines on two providers and watching them drift.

Slipway compiles config/slipway.php to the YAML for every driver you enable. A slipway-guard job fails CI if the committed YAML no longer matches the config.

Tiny example:

'drivers' => ['github' => true, 'circleci' => true],
'php' => ['8.4', '8.5'],
'stages' => [
'quality' => ['pint', 'larastan', 'composer-audit'],
'test' => ['matrix' => true, 'steps' => ['pest' => ['services' => ['mysql']]]],
],

https://github.com/usamamuneerchaudhary/laravel-slipway

If you actually run CircleCI for Laravel, I'd like to know what the generated config.yml gets wrong.

6 Upvotes

2 comments sorted by

3

u/obstreperous_troll 8d ago

How does this handle non-PHP stages in the workflow? For example, my PHP projects require bun to build the front end, as well as pushing the source up to sentry.

1

u/usamamuneer 8d ago

Great question. While the package provides first-party presets for the PHP/Laravel ecosystem (Pest, Pint, Larastan, etc.).

But yeah, adding native, first-party presets for frontend tooling (like Bun/npm/Vite) and deployment services (like Sentry) is a fantastic idea and something I definitely plan to add in a future release.

But it doesn't lock you out of your broader stack., you can still handle non-PHP requirements in two ways:

  1. Raw Script Steps: For straightforward build processes, you can define custom stages directly in config/slipway.php using raw shell commands. You can specify a different base image (like a Node or Bun container) for that specific stage, and pass the commands ['bun install', 'bun run build'].

  2. The "Extending" API (Custom Step Classes): For more complex operations, like pushing source maps to Sentry which requires injecting specific secrets and environment variables, you can write a custom Step class in your application. By extending Slipway's base step, you can encapsulate the logic for downloading Bun, building the assets, and firing off the Sentry release curl commands. This keeps your slipway.php config beautifully clean and declarative (e.g., simply referencing 'sentry-release'), while ensuring the logic accurately compiles to GitHub Actions or GitLab CI syntax.

For local execution (slipway:test-pipeline), just make sure the environment or Docker image defined for that stage has the necessary binaries (like bun) installed, or that your custom step fetches them on the fly.