Skip to content

Run Mortise rules in CI

Mortise, the desktop app for laravel-modules, keeps its boundary rules in mortise.json at the project root. Larch runs the same rules in Pest, so CI checks what Mortise shows.

Create one test:

tests/Arch/MortiseTest.php
<?php
arch()->preset()->mortise();

Run it:

Terminal window
./vendor/bin/pest tests/Arch/MortiseTest.php

The preset is one Pest test. A failure lists the breaks of each rule under its name.

Edit the rules in Mortise, or edit mortise.json:

mortise.json
{
"rules": {
"no-circular-use": true,
"public-surface-only": { "enabled": true, "folders": ["Contracts", "Events"] }
}
}

Without the file, both rules are on, with the folders Contracts and Events.

Turn the module off in modules_statuses.json at the project root. A module that is off breaks no rule, and no link to it does.