Add CI - #2412
Open
elcreator wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a basic CI pipeline and nightly build pipeline for
3.5.x, plus the sourcefixes needed to make both green.
There is no CI on this branch today, so this starts with the two commands the
project already defines:
composer analyze(PHPStan) andcomposer test(Pest).What's added
.github/workflows/ci.yml— runs on push to3.*.x, on every PR, and manually:analyze— rootcomposer install→composer analyze. Only root dependencies areneeded:
core/vendoris committed and covers everythingphpstan.neonbootstraps.tests—composer installincore/→composer test.Both run on a
['8.3', '8.4']matrix withfail-fast: false, so thecomposer.jsonfloor (
^8.3) and the recommended version are reported separately..github/workflows/build.yml— two independent jobs:zip— installs dependencies with--no-dev, installs the CMS on sqlite via the CLIinstaller, makes the build relocatable, verifies it answers over HTTP, and packages it.
Published as a workflow artifact (14 days) and, on push, as a
nightly-<branch>prerelease so testers get an anonymous direct download link.
docker— takes the exact tree produced byzipand bakes it into an image pushed toGHCR. The runtime recipe comes from
evolution-cms/salo2runtimes/8.4/Dockerfile(Salo is the Evolution CMS flavour of Sail):php:8.4-apachewith gd/zip/pdo and mod_rewrite. Skipped on pull requests — forks get a read-only token
and cannot push packages.
.github/docker/Dockerfile— thin layer over the Salo runtime: copies the built tree,promotes
ht.accessto.htaccess, fixes ownership.Source changes required by the above
install/cli-install.php— sqlite support. The web installer already supports sqlite(
install/src/functions.phpaccepts['pgsql', 'sqlite', 'mysql']and skipshost/user/password for it), and the runtime defaults to the sqlite driver, but the CLI
installer's whitelist was
['pgsql', 'mysql']. Passing--databaseType=sqlitesent itinto an infinite
readlineloop. Changes:sqliteadded to the database type list;sqlite:<core/database/name.sqlite>DSN, with the directory created if missing;checkConnectToDatabaseWithBase()returns early since the file is the connection;writeConfig()gained asqlitecase — otherwise the unreplaced[+database_port+]placeholder ended up in the generated config;
--skipComposer=yflag: the installer otherwise runscomposer updatemid-install,which would rewrite
composer.lockinside a build.PHPStan fixes (
includeOnce.fileNotFound/include.fileNotFound):core/src/ManagerTheme.php— the install-flag path moved intogetInstallProcFile().The rule ignores runtime
is_file()guards entirely: it constant-folds the path andchecks the disk at analysis time, and
assets/cache/installProc.inc.phpis generated atinstall time, so it never exists in a fresh checkout. Also removes four repetitions of
the same concatenation.
core/src/Services/Store/PackageInstallFlowService.php—include "instprocessor-fast.php"now uses
$this->modulePath . '/installer/instprocessor-fast.php". The relative literalonly resolved because of a preceding
chdir(), which static analysis cannot model..gitignore—**/.*was silently ignoring.github; added!/.github.Verification
Everything below was run locally against a clean checkout of this branch.
composer analyze: 0 errors on PHP 8.3 after the fixes (was 2). On 8.4 sixunset.possiblyHookedPropertyerrors remain (5 inCore.php, 1 inMysqlDumper.php) —property hooks are 8.4-only, so that matrix leg is red until those are addressed.
core/database/evolution.sqlite,install/removed, config written.rewrites it to
dirname(__DIR__, 3). After moving the tree, front page and manager bothreturn 200. No build-machine paths remain anywhere in the tree.
/manager/return 200, sqlite file and cache are writable by
www-data.core/.install, the database) survive thezip/unzip round trip.
CliInstallTestpasses, and the full suite result is identical with and withoutthese changes.
Known: the suite is not green today
composer testcurrently reports 15 failures / 246 passing on a clean Linux checkout —all pre-existing and unrelated to this PR (verified by reverting the changes and re-running
in the same environment; the exact count varies with environment state). Examples: the eight
CoreTest > getTagsFromContentcases, andRemoveLocksConfirmMessageTest, which expectsmodx.lang.confirm_remove_lockswhilemanager/media/style/default/js/evo.js:1818hasevo.lang.….So the first CI run will be red by design — it reports the branch's real state. Worth
knowing before enabling branch protection.
Relationship to the
nightlybranchThe
nightlybranch (last commit 2025-11-11) already carries a Docker pipeline:a root
Dockerfile,docker/entrypoint.sh,docker-compose.yml(postgres + adminer), and.github/workflows/docker-nightly.ymlpublishing multi-arch images to Docker Hub(
dmi3yy/evolution-cms) on manual dispatch.These two do not conflict as files — that work lives on a separate branch — but they answer
the same question differently:
nightlyGITHUB_TOKENis enough3.*.xIf
nightlyis ever merged into3.5.xthere would be two Dockerfiles and two Docker jobs,which is worth untangling in advance.
Three things noticed while comparing, none addressed here:
nightlyDockerfile runscomposer update(notinstall) at build time, so imagesare not reproducible and the lock file is ignored.
entrypoint.shpasses--databasePort="${DB_PORT}", butInstallEvohas nodatabasePortproperty on either branch, and the argument parser only assigns toexisting properties — so the flag is silently dropped and a non-default port never
reaches the config.
cli-install.phponnightlyhas the same['pgsql', 'mysql']whitelist, so the sqlitesupport here does not duplicate that branch — it closes the same gap.
The sqlite mode and
--skipComposerwould both benefit that entrypoint: a container couldthen start with no database service at all.