Cache on GHA is immutable. For this reason, hendrikmuhs/ccache-action creates a
new cache entry for each push, each with an appended timestamp, which fills the
cache very quickly. In an attempt to fix this, we've disabled the
append-timestamp option and appended a hash of php_version.h. Hence, we'll only
get a new cache file once this file is touched.
However, since this file rarely ever updates for master, we're relying on an
extremely outdated cache. To fix this, append the current year+week to rebuild
the cache each week instead, as suggested by Tim. Also use major.minor.release
version instead of the has of php_version.h for readability.
Fixes GH-14154
Closes GH-21258
git rev-parse fails with the long GH ref, but we need github.ref to check out
branches from PRs. Hence, use github.ref only for PRs, and the ref_name for
everything else.
Closes GH-21255