Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.56 KB

File metadata and controls

36 lines (28 loc) · 1.56 KB

Dagger CI

A Dagger module (TypeScript SDK, .dagger/) runs the quality suite in php:8.5-cli-trixie containers — reproducible locally and in CI:

dagger call quality   # or: mise ci — runs all four checks in parallel
dagger call test          # PHPUnit (SQLite test database)
dagger call lint          # php-cs-fixer --dry-run
dagger call analyse       # PHPStan level 8
dagger call rector-check  # Rector --dry-run

Dagger needs a Docker engine, so run it from the host (or a CI runner), not inside the devcontainer.

How it works

base() builds a PHP 8.5 container with the required extensions (intl, pdo_pgsql, redis, …), a Composer binary, and cached Composer downloads / PHPStan results (Dagger cache volumes), then mounts the project source and runs composer install --no-scripts.

The source mount excludes vendor, node_modules, var, .env*, .git, .dagger, public/build, and config/jwt:

  • A minimal .env is generated inside the container (SQLite DATABASE_URL, null mailer, dummy secrets) so the suite is fully self-contained.
  • config/jwt is excluded so test() always generates a fresh JWT keypair whose passphrase matches that generated .env — locally-generated dev keys would mismatch.
  • var/cache and var/log are recreated inside the container before Symfony boots.

test() provisions the SQLite schema (doctrine:schema:create --env=test) and the JWT keypair before running PHPUnit; quality() runs all four functions with Promise.all, each in its own container fanning out from the shared base() layer.