This repository was archived by the owner on Apr 9, 2026. It is now read-only.
Close #8: Implement caching#14
Merged
Merged
Conversation
For now we cache only the PHP SDK, the PHP binaries and the development packs. This already greatly improves the setup performance (it might easily safe a minute or two, in case of cache hits). To be able to use the current PHP revision as part of the cache key, we factor out determine-revision.ps1. We create a separate cache for the PHP-SDK since this likely rarely changes, and since the cached variant is apparently much faster than fetching a GH release of the PHP-SDK. Since clients may not want to use the cache, possibly because they have already a lot of other files in their caches, we explicitly require clients to opt-in via the `cache` input parameter.
nikic
approved these changes
Sep 29, 2024
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
For now we cache only the PHP SDK, the PHP binaries and the development packs. This already greatly improves the setup performance (it might easily safe a minute or two, in case of cache hits). To be able to use the current PHP revision as part of the cache key, we factor out determine-revision.ps1. We create a separate cache for the PHP-SDK since this likely rarely changes, and since the cached variant is apparently much faster than fetching a GH release of the PHP-SDK.
Since clients may not want to use the cache, possibly because they have already a lot of other files in their caches, we explicitly require clients to opt-in via the
cacheinput parameter.I encourage all users of setup-sdk-action to try this out. See https://github.com/php/pecl-database-dbase/actions/runs/11094514089 for a demonstation; php-sdk-2.3.0, php-7.4.33-x64-ts and php-8.4.0RC1-x64-ts had already been cached prior to this run; still a nice performance improvement for the other PHP versions. Now compare that with your setup times (likely two to four minutes per job).