Repository navigation
Cache Composer downloads in the CI workflows - #376
Merged
Merged
Conversation
Every job ran composer install from a cold cache, and tests.yml alone runs 24 matrix jobs per push. Each workflow now restores Composer's cache-files-dir with actions/cache before installing, keyed on the runner OS, the PHP version and composer.json (there is no composer.lock). The directory is read in a bash step so the Windows jobs resolve it too. The cache is saved at the end of the job, so the packages required after the install (mpdf/font-bundle-lite, phpstan/phpstan) are in it as well; their names go in the key so jobs that share an OS and PHP version across workflows do not overwrite each other's cache. Closes #353 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #353.
Every workflow ran
composer installfrom a cold cache, andtests.ymlalone runs 24 matrix jobs per push.Changes
tests.yml,snapshots.yml,cs.yml,static-analysis.ymlandcoverage.ymleach gain two steps before "Install dependencies":composer config cache-files-dirin abashshell so the Windows jobs resolve it too.actions/cache@v6on that directory.Key:
composer-<os>-php<version>-<extras>-<hash of composer.json>, restoring from the same prefix without the hash (there is nocomposer.lock).<extras>isfont-bundle-litefor tests/coverage andphpstanfor static-analysis. The cache is saved at the end of the job, so it also holds the packages required after the install. Having their names in the key stops jobs in different workflows that share an OS and PHP version from overwriting each other's cache.Notes
mpdf/font-bundle-liteorphpstanreleases a new version whilecomposer.jsonis unchanged, that one package is downloaded on each run untilcomposer.jsonchanges.conformance.yml(Write PDF/A-2b and PDF/A-2u documents that keep their transparency #330) isn't ongravitypdfyet, so it isn't touched here. Whichever PDF/A branch lands later needs the same two steps.coverage.ymlonly runs ondevelopment/coveragepushes. It is changed anyway so all the workflows match.Testing
actionlintreports nothing in the new lines. Its only report, SC2016 on "Let Imagick read PDFs", was there before and is intended.🤖 Generated with Claude Code