We don't need the whole cache, since most (all?) of it is stored on
Develocity already.
Including ./gradle/caches/modules-2 is enough, because that's where
Maven dependencies are stored, and *those* are not stored on Develocity.
(cherry picked from commit 013bb46470)
Ripped off from Quarkus.
Here's how it will work:
1. We create a cache entry on push only. Pull requests only restore it.
2. We create a new cache entry every day, prefixed with something like
2024-10-25.
3. When restoring the cache, we try the entry for the day first
(2024-10-25) and default to the one for the month (2024-10-*).
Critically, this means we will build each day's cache based on the
previous day's cache.
4. Atlas infra uses its own, separate cache entries.
Co-Authored-By: Guillaume Smet <guillaume.smet@gmail.com>
(cherry picked from commit 5eaaff2e63)