Skip to content

Move CI onto the awcodes/.github shared workflows - #69

Merged
awcodes merged 4 commits into
4.xfrom
feat/shared-ci-workflows
Sep 9, 2026
Merged

awcodes merged 4 commits into
4.xfrom
feat/shared-ci-workflows

Conversation

@awcodes

@awcodes awcodes commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Migrates this package onto the shared reusable CI workflows in awcodes/.github, matching the rest of the fleet. Config baseline, formatting sweep and workflow swap are separate commits.

Layer B — config baseline

  • pint.json / rector.php replaced with the canonical templates. pint.json was missing five rules; two of them actually apply here (types_spaces, concat_space). rector.php now also covers workbench/.
  • phpstan.neon.dist added. This package had no static analysis at all — no config, no baseline, no larastan, no test:types. Level 5 over src/ and workbench/; config/ and database/ stay commented out because the package ships neither and phpstan hard-errors on a missing path. The explicit vendor/larastan/larastan/extension.neon include is required here, since phpstan/extension-installer is not a dev dependency (its allow-plugins entry is a leftover).
  • require-dev gains larastan/larastan, pestphp/pest-plugin-arch and nunomaduro/collision; scripts gains test:types, wired into test. pestphp/pest-plugin-livewire is dropped — the suite has no Livewire tests. The runtime require block is untouched.

The package passes level 5 clean, with an empty baseline. Level 5 flagged exactly one thing, on StickyHeaderPlugin::get(): filament() is typed FilamentManager|Plugin, so the declared static return does not narrow. That is annotated rather than baselined — the plugin registered under this plugin's own id is a static by construction, so the declared type is already right and a baseline entry would only hide it. Same fix awcodes/recently applies to the identical idiom.

Layer A — workflows

ci.yml calls filament-plugin.yml@v1 with the standard seven-row matrix. Tests, lint, static analysis and reformat all run.

All seven rows were verified to resolve against this package's transitive constraints, and the per-row Filament pin does its job — the F5 rows land filament/filament 5.8.1, the F4 rows 4.13.1. The suite was run locally at both extremes (F4/L12/TB10 and F5/L13/TB11): 13 passed, 20 assertions each.

run-build: false. The suite does not need the compiled bundle — StickyHeaderServiceProvider only hands the dist path to FilamentAsset::register(), which stores it without reading the file, and the suite passes with resources/dist/sticky-header.js deleted. Building it on every row would buy nothing. Freshness is checked once instead, in the assets job.

assets job

resources/dist/sticky-header.js is committed and shipped, so a resources/js change that lands without a rebuild silently publishes a stale bundle. The old assets.yml rebuilt and auto-committed after merge, which left the branch stale until that job ran and meant the generated diff was never reviewed. The new job rebuilds and fails the PR if resources/dist moves. The committed bundle is currently up to date — a local rebuild produced no diff.

Removed

File Why
assets.yml Replaced by the assets job, which reports instead of auto-committing.
lint.yml Rebuilt and pushed formatting onto merged branches. Lint and Reformat now report instead of rewriting.
tests.yml Its matrix had no Filament pin, so every row resolved Filament 5 under prefer-stable and the ^4.0 half of this package's constraint was never actually executed.

composer.lock is also dropped from the paths filter — it is gitignored and untracked here, so it could never trigger a run.

Dependabot

Resynced from the template in this same change. It gains a composer ecosystem, grouped so dev tooling arrives as one weekly PR while runtime constraint changes stay reviewable, and it ignores awcodes/.github/* because the caller deliberately tracks the moving @v1 tag.

The auto-merge workflow is replaced in the same PR, not later: it previously auto-merged every minor and patch Dependabot opened, so adding the composer ecosystem without narrowing it first would have started merging dependency bumps unreviewed. It is now scoped to github-actions bumps and the dev-dependencies group only.

Auto-merge stays inert — and should — until "Allow auto-merge" is enabled and a 4.x ruleset requires the ci / All Checks status check.

Verification

composer test (refactor → lint → types → unit) passes locally: 13 tests, 20 assertions, phpstan clean, 0 baseline entries.

Rector is clean on both src/ and workbench/ with nothing to change, so there is no rector commit. That was confirmed rather than assumed — a deliberately refactorable probe file dropped into workbench/app/ was picked up and flagged, so the path really is being analysed.

The two PHP 8.5 rows could not be executed locally (local PHP is 8.4). Their dependency resolution was verified via config.platform.php=8.5.0, but CI is the only evidence that the suite itself passes on 8.5.

🤖 Generated with Claude Code

https://claude.ai/code/session_017QxdNSNdqXRproytP5odgW

awcodes and others added 4 commits September 9, 2026 12:51
Normalizes this package's tooling config onto the canonical templates in
awcodes/.github ahead of moving to the shared reusable workflows:

- pint.json / rector.php replaced with the canonical templates. pint.json was
  missing five rules (blank_line_before_statement, concat_space,
  method_argument_space, single_trait_insert_per_statement, types_spaces);
  rector now also covers workbench/, which is hand-written code.
- phpstan.neon.dist added — this package had no static analysis at all. Level 5,
  analysing src/ and workbench/. config/ and database/ stay commented out
  because the package ships neither and phpstan hard-errors on a missing path.
  The explicit larastan extension.neon include is required here:
  phpstan/extension-installer is not a dev dependency (its allow-plugins entry
  is a leftover).
- phpstan-baseline.neon seeded from the empty template so the config's
  `includes` resolves; the generated baseline lands in a follow-up commit.
- require-dev gains larastan/larastan, pestphp/pest-plugin-arch and
  nunomaduro/collision; scripts gain test:types, wired into `test`.
  pestphp/pest-plugin-livewire is dropped: the suite has no Livewire tests.
  The runtime `require` block is untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QxdNSNdqXRproytP5odgW
Pure formatting, no behaviour change. Driven by the two new rules the previous
pint.json was missing that actually apply here:

- types_spaces (space: single) — `bool|Closure` becomes `bool | Closure` in
  src/, tests/ and workbench/.
- concat_space (spacing: one) — `__DIR__.'/..'` becomes `__DIR__ . '/..'`.

Kept separate from the config change so the reformat is reviewable on its own.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QxdNSNdqXRproytP5odgW
`filament()` is typed to return `FilamentManager|Plugin`, so the declared
`static` return on `get()` is the one thing level 5 flags in this package:

    Method StickyHeaderPlugin::get() should return
    static(Awcodes\StickyHeader\StickyHeaderPlugin) but returns
    Filament\Contracts\Plugin|Filament\FilamentManager.

Annotated rather than baselined. The plugin registered under this plugin's own
id is a `static` by construction, so the declared type is already correct and a
baseline entry would only hide it. This is the same fix awcodes/recently applies
to the identical idiom, and it leaves the package passing level 5 clean with an
empty baseline.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QxdNSNdqXRproytP5odgW
Replaces the three bespoke workflows with one caller on the shared reusable
workflow, scoped to the active 4.x branch.

- .github/workflows/ci.yml calls filament-plugin.yml@v1 with the standard seven
  row matrix. All seven were verified to resolve against this package's
  transitive constraints: the F5 rows land filament 5.8.1, the F4 rows 4.13.1.
  filament-package stays at its default — this is a panel plugin, so
  filament/filament is the right package to pin. Tests, lint, static analysis
  and reformat all run.

- run-build is false. The suite does not need the compiled bundle:
  StickyHeaderServiceProvider only hands the dist path to
  FilamentAsset::register(), which stores it without reading the file, and the
  suite passes with resources/dist/sticky-header.js deleted. Building it on
  every matrix row would buy nothing.

- An `assets` job takes over from assets.yml. Rather than rebuilding and
  auto-committing after merge — which left the bundle stale until that job ran,
  with the diff never reviewed — it rebuilds and fails the PR if
  resources/dist has changed, so a stale committed bundle is caught before
  merge.

- composer.lock is dropped from the paths filter: it is gitignored and untracked
  in this package, so it can never trigger a run.

Removed: assets.yml, lint.yml (rebuilt and force-pushed formatting onto merged
branches; the Lint and Reformat jobs now report instead of rewriting), tests.yml
(its matrix had no Filament pin, so every row resolved Filament 5 and the ^4.0
half of the constraint was never executed).

Dependabot is resynced from the template in the same change. It gains a composer
ecosystem, grouped so dev tooling lands in one weekly PR while runtime
constraint changes stay reviewable, and it ignores awcodes/.github/* because the
caller tracks the moving @v1 tag. The auto-merge workflow is replaced at the
same time and not later: it previously auto-merged every minor and patch
Dependabot sent, so adding the composer ecosystem without narrowing it would
have started merging dependency bumps unreviewed. It is now scoped to
github-actions bumps and the dev-dependencies group only.

Note that auto-merge stays inert, and should, until "Allow auto-merge" is on and
a 4.x ruleset requires the `ci / All Checks` status check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QxdNSNdqXRproytP5odgW
@awcodes
awcodes merged commit 71743cd into 4.x Sep 9, 2026
13 checks passed
@awcodes
awcodes deleted the feat/shared-ci-workflows branch September 9, 2026 17:08
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.

1 participant