Every Magento module I publish needs the same CI: validate composer.json, lint the PHP, run PHPCS and PHPStan, check the declared dependencies, then PHPUnit on each release I support. This repository holds that once, as reusable GitHub Actions workflows. A module’s CI is one uses: line, and when Magento ships a new release the supported list changes here and every module picks it up on its next run.
As of 23rd November 2026, nine of my modules call it: Verbose DB Status, Media Proxy, Fetch Priority, Cache Debounce, Auto Login Admin, TinyMCE Anchors, Performance, and the example banner and footer modules used to validate deployments.
What does a module’s CI look like with it?
One job. This is the whole of Cache Debounce’s .github/workflows/ci.yml, minus the on: block:
jobs:
ci:
name: CI
uses: samjuk/github-actions/.github/workflows/magento2-module.yaml@c64a99ecd100b285c80505fc8f5bcf94108153a7 # magento-module/v1.0.0
magento2-module runs lint first, then static analysis and the dependency check side by side, then PHPUnit on every release in the supported list. A single Required job at the end passes only when every other job did. That is the one check to require on a branch, because the PHPUnit check names include the Magento version and change with every release.
A module only passes inputs when it differs from the default: directory for a module that is not at the repository root, and exclude to drop releases it does not support. A module with no Test/ directory gets a warning and the DI compile, so the example modules no longer turn the test inputs off.
magento-supported-versions returns the release list as JSON. By default that is Magento 2.4.9, 2.4.8-p5, 2.4.7-p10 and 2.4.6-p15, plus Mage-OS 3.6.0. exclude takes a glob such as 2.4.9*, so nobody keeps their own copy of the list.
What is in it?
Reusable workflows:
| Workflow | What it runs |
|---|---|
magento2-module | Lint, static analysis, the dependency check, the release list and module PHPUnit, as a module’s whole CI. |
magento2-test-lint | composer validate, php -l on every PHP file, and YAML and XML linting. magento2-module turns its php -l off and lints in each PHPUnit cell instead (see below). |
magento2-test-static | PHPCS at severity 6. A module with its own phpcs.xml.dist (or phpcs.xml, .phpcs.xml) gets its dependencies installed and runs its own vendor/bin/phpcs against its own <file> list; mine extend the dev-standards ruleset from vendor. Without one, a shared ruleset (Magento coding standard, 140 character lines, docblock rules relaxed). PHPStan with bitexpert/phpstan-magento, at level 5 unless the module ships its own phpstan.neon. Findings fail the job. |
magento2-test-dependencies-module | Installs the module into Magento and checks it declares what it uses, in composer.json and module.xml (Yireo ExtensionChecker). |
magento-supported-versions | The shared release list above. |
magento2-test-phpunit-module-ghas | Unit tests, setup:di:compile and integration tests for a module. |
magento2-test-phpunit-project-ghas | The same for a whole project, globbing app/code. |
Actions they build on:
magento/compute-software-requirementsmaps a Magento or Mage-OS version to its PHP, Composer, MySQL, MariaDB, OpenSearch, Redis, Valkey, Varnish and RabbitMQ versions. The data is amanifest.jsoncovering 70 Magento versions from 2.4.4 to 2.4.9, scraped from Adobe’s system requirements page with a browser console script kept next to it.warden/versionsreads a Warden.envand outputs the same keys, following Warden’s own defaults for anything the file leaves unset. The project workflow takes it throughwarden_env_file, so a Warden project tests on the PHP, database and OpenSearch versions its developers run, MariaDB included.
How does the PHPUnit workflow get a Magento install?
It does not install one. The job runs inside the pre-installed Magento CI testing image for that release, samjuk/magento-ci-testing-env:<version>-php<php> (or the Mage-OS equivalent), with MySQL, Redis and OpenSearch as service containers at the versions compute-software-requirements picks.
Before anything else, it runs php -l and an XML well-formedness check over the module on that image’s PHP. Linting once on PHP 8.4 passed code that 2.4.6 and 2.4.7 cannot parse. With the lint in each cell, a test file using PHP 8.4 asymmetric visibility (public private(set) string $name) failed the 2.4.6 and 2.4.7 cells and passed 2.4.8, 2.4.9 and Mage-OS. The images are Alpine with no bash, so the lint scripts are plain sh.
From there it requires the module from the checkout through a Composer path repository, runs Test/Unit, runs setup:di:compile, points the integration test config at the services and runs Test/Integration. Either test directory can be missing and is skipped. If neither exists, the job warns and runs only the DI compile.
How do modules pin a version without churn?
Modules pin a commit, with the release in a comment, and Dependabot raises a pull request when there is a new one. The release only moves when files the module actually runs have changed.
Releases are tagged per family, as magento-module/vX.Y.Z. A family is an entry workflow plus everything it reaches through $/ references, worked out by bin/release.sh: for magento-module that is 12 files. A change anywhere else in the repository releases nothing for it, so a module never gets a bump PR for a workflow it does not call. The bump comes from the Conventional Commits since the last tag: ! is major, feat minor, anything else patch.
Inside the repository, workflows call their own children as $/.github/..., which GitHub resolves to the commit the caller pinned. In Cache Debounce’s run on v1.0.0, all 11 downloads of this repository’s actions were at c64a99e, not @master.
Each tag points at a commit of its own: master’s tree, with master as parent, on no branch. That looks odd, but I tested the alternatives against GitHub’s own Dependabot in a throwaway lab repository first:
@v1and@masternever get a pull request.- A moving
v1tag next to a SHA pin, with no version tags, bumped to the untagged branch head. - With two families tagged on one commit, Dependabot took the wrong family. It picks the last of the commit’s tags, sorted by version, so one commit per tag is the only safe layout.
- A dash prefix (
magento-module-v1.0.0) on a SHA pin did nothing, silently. The slash prefix works per family.
Immutable releases are on, so a published tag cannot be moved or deleted. The release runs by hand, from the Actions tab or locally, rather than on a schedule. A scheduled job would mostly find nothing to release.
The first release, magento-module/v1.0.0, went out on 23rd November 2026. Dependabot’s first run on the pinned modules read the pin as version 1.0.0, with nothing to update.
Why is there no Warden workflow?
I tried twice. The first Warden-run PHPUnit workflows, in July 2026, were slower than the service-container ones and hit a permission problem I never solved: after composer install inside Warden, the container owned dev/, so the runner could not edit the test config. I removed them and kept the older unit-only Warden workflows around.
In November I rebuilt both with a fix for the permissions, then dropped them again before they had a green run. Nothing called them, and they doubled every change to the test steps. What a Warden project actually wants from CI is its own service versions, and warden/versions gives the GitHub services workflow exactly that. The unit-only Warden workflows and the warden/create-env and warden/setup-environment actions went in the same release.
How is it tested?
Against fixture modules in the repository. Each reusable workflow and action has an _internal-test-* workflow that calls it on changes:
- the module workflow runs against
demo-packagefor unit and for integration tests, againstdemo-package-unit-onlywith both flags on (to prove the missing integration directory is skipped), and again for an older PHPUnit, the Mage-OS image swap and a PHP version override; - the project workflow runs against
demo-project, once more taking its versions from the fixture’s Warden.env(MariaDB 11.4 instead of MySQL); warden/versionsruns against Warden’s ownmagento2template, a file with nothing but the environment type, and one with CRLF line endings, quoted values and services switched off, and must fail on a missing file;- the lint, static and dependency workflows run against fixtures that must pass, including one that only passes PHPStan with bitexpert’s extension (it uses a generated factory), and the dependency check runs on both Magento and Mage-OS;
- the supported versions workflow is called three ways (default, include and exclude, Mage-OS scoped) and an assert job compares each output with the exact JSON expected.
The demo-package-no-tests fixture now runs through the module workflow too, since a module without tests warns instead of failing. GitHub Actions does not allow continue-on-error on a job that calls a reusable workflow, so an expected failure would leave a self-test permanently red. The failure paths were proven by hand instead, against a private test module before release: the PHP 8.4 file above, and a phpcs.xml.dist with a 10 character line limit, which failed PHPCS with 38 errors and turned Required red.
Is this the same as magento.works?
No. It answers one question: does my module still work on every release I support? The images it runs on are the Magento CI testing images, which take the Magento install out of each run. magento.works asks a different one: which service versions each Magento release actually runs on.
What is still rough?
- Pin the rest. Cache Debounce and Example Banner pin
magento-module/v1.0.0; the other modules still call@master, so a change here reaches them on their next run. - Release on merge. The release is manual, so a merged change reaches pinned modules only once someone runs it.
- Run integration tests on 2.4.4 or earlier. Those releases default to Elasticsearch 7 settings the workflow does not configure, which is why 2.4.4 is out of the default list.
- Prove the failure paths in CI. The negative controls above were run by hand; the self-tests still only use fixtures that should pass, so a check that silently stopped failing would go unnoticed.
- Read a Warden
.envin the module workflow. A module tests across a list of releases, so one.envdoes not fit; only the project workflow takes one.