Custom CI image with PHP 8.4 baked in (avoid setup-php entirely) #17
Labels
No labels
bug
ci-cd
duplicate
enhancement
help wanted
layout
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/rater#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
See #16: CI's "Set up PHP" step (
shivammathur/setup-php@v2) takes 7m46s of a ~9min pipeline. Investigation found thatactions/cache@v4never successfully saves on this runner (root cause undetermined after ~2h investigation, deprioritized) — so caching/usr/local/phpwas never going to help anyway, separately from the cache backend issue (setup-phpinstalls to/usr/bin/php, not/usr/local/php).This ticket is the actual fix: build a custom CI image with PHP 8.4 + required extensions + composer already baked in, eliminating "Set up PHP" entirely — replaced by a
docker pullof a (registry-cached) image layer.Scope
Dockerfile(e.g..forgejo/ci.Dockerfileor similar location), based oncatthehacker/ubuntu:act-latest, with PHP 8.4 + extensions (pdo_pgsql, mbstring, xml, dom, intl, pcov) + composer pre-installed.forgejo/workflows/ci.yml:container.imagepoints to the new custom image; remove "Set up PHP" step (already removed the dead cache steps as part of #16's pivot)Verification
php -v, extensions, and composer version match what the workflow currently expects (PHP 8.4.x, pdo_pgsql/mbstring/xml/dom/intl/pcov enabled, composer 2.x)Result ✅
Done. New
.forgejo/ci/Dockerfile(PHP 8.4 + pdo_pgsql/mbstring/xml/dom/intl/pcov via ondrej/php PPA + Composer fromcomposer:2, on top ofcatthehacker/ubuntu:act-latest), built and pushed toforge.lvl0.xyz/lvl0/rater-ci:latestby.forgejo/workflows/ci-image.yml(push-to-main only, path-filtered to the Dockerfile/workflow itself).ci.ymlnow uses this image and no longer runssetup-php. Verified:Remaining cost is "Install dependencies" (composer install, ~1m27s, uncached due to #16's unresolved cache issue) — considered baking
vendor/into the image too, but rejected: dependency-bump commits would trigger a slow image rebuild, and PRs changingcomposer.lockwould run against a stale baked-invendor/, which is exactly the case where correctness matters most. Left for #16 to potentially address via a different caching approach later.PLATFORM.md updated with the new CI image setup and rebuild instructions.