perf: optimize ImageMagick installation in GitHub Actions workflows#10005
Merged
paulbalandan merged 1 commit intocodeigniter4:developfrom Feb 25, 2026
Merged
Conversation
Remove unnecessary dependencies and redundant installation commands that cause significant slowdowns on PHP 8.4. Changes: - Remove --reinstall flag which forces unnecessary downloads - Remove unneeded packages (fonts, ghostscript, poppler, etc.) - Remove problematic --fix-broken call - Use --no-install-recommends to skip optional dependencies - Consolidate installation into single apt-get command This reduces installation time from 10+ minutes on PHP 8.4 to 2-3 minutes, matching other PHP versions.
bea81b1 to
26d5e82
Compare
michalsn
approved these changes
Feb 24, 2026
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.
Description
This PR optimizes the ImageMagick installation step in GitHub Actions workflows to significantly reduce execution time, especially for PHP 8.4 where the current implementation takes over 10 minutes.
Problem
The current ImageMagick installation process:
--reinstallflag which forces redownloading packages--fix-brokencall that suggests unresolved dependency conflictsSolution
The optimized installation:
--reinstallflag--fix-brokencallChanges
Updated two workflow files:
.github/workflows/reusable-phpunit-test.yml.github/workflows/reusable-serviceless-phpunit-test.ymlThe optimized installation now includes only necessary packages:
imagemagick- core ImageMagick librarylibmagickwand-dev- PHP imagick extension development headersghostscript- PostScript/PDF rendering (required for image processing)poppler-data- PDF rendering supportlibjbig2dec0:amd64- JBIG2 image compression supportlibopenjp2-7:amd64- JPEG2000 supportThis reduces installation time from 10+ minutes to ~2-3 minutes on PHP 8.4, matching other PHP versions.
Collaboration
This work was developed with assistance from GitHub Copilot (Claude AI), which helped identify the performance bottlenecks, propose optimizations, and validate the implementation.
Checklist