crazywhalecc / static-php-cli

Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.
https://static-php.dev
MIT License
1.34k stars 234 forks source link

Update actions #428

Closed simonhamp closed 7 months ago

simonhamp commented 7 months ago

What does this PR do?

This reduces errors and improves build times.

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option. If a modification is not involved, please skip it directly.

crazywhalecc commented 7 months ago

Previously I modified test workflow for dynamic caching: Just cache downlods dir again and again. When new extension added, it will automatically skip downloading other sources that has been cached.

Also, in some particularly rare cases, as long as cache-hit != 'true' is used, the cache will not be hit, with no reason.

simonhamp commented 7 months ago

@crazywhalecc I'm not sure I follow you. The cache in these didn't appear to be working at all because the key name was incorrect. This had the result of always downloading the extension files.

This PR fixes that so each action will now correctly cache the set of extensions that were requested.

This should make builds of the same PHP-version+OS+extension set a little faster, at least during the cache's lifetime.

simonhamp commented 7 months ago

In case it's not clear, this dependency cache is the extension build files (the result of bin/spc download).

I think the variance you were seeing in cache-hit != true was exactly down to this problem of commas in the key name.

This is why I've hashed the details of the build into a key name that will never have commas regardless of how the build is configured.

crazywhalecc commented 7 months ago

What I mean is that today's best caching strategies don't perform well in Actions. It has nothing to do with this PR. After fixing this small problem, we merge it into the main branch and test it again.