quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.61k stars 2.64k forks source link

Don't cache m2 repo in GitHub Actions for PRs and take advantage of saved space #43559

Open yrodiere opened 4 hours ago

yrodiere commented 4 hours ago

Description

We're currently using the GitHub Actions cache for very dubious things, especially on PRs:

Ideally we'd cache them, but it's 1 to 2GB per PR, which is not sustainable considering the global 10GB limit for all branches and PRs:

  1. We're likely only ever be caching up to 3 PRs at any given time.
  2. This is likely causing cache evictions for more important caches on the main branch, leading to cache misses for all builds (main or PR).

We should stop doing that, and take advantage of that saved space to cache other, more space-efficient things on PRs.

Implementation ideas

We should prevent cache writes for Maven dependencies / gradle setup on PRs. There's a lookup-only option on the cache action that does just that [EDIT: Wrong, it does something else]. We'd only write to the cache from branch builds, restricting ourselves to read on PRs (so PRs benefit from the main branch's cache). This would save several GBs from our current cache usage, between 2 and 4GB depending when you check (you can check here).

Using that saved space, we should enable cache read/write for the Develocity local build cache on PRs. This hopefully would take less that 4GB, and could result in much faster PR builds/testing, especially for small, incremental pushes to PRs.

See https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Persistent.20Develocity.20build.20cache.20in.20PRs/near/435358207

quarkus-bot[bot] commented 4 hours ago

/cc @gwenneg (cache)

quarkus-bot[bot] commented 4 hours ago

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip

This message is automatically generated by a bot.

yrodiere commented 4 hours ago

/cc @gwenneg (cache)

Sorry for the ping: the bot is wrong, this is not related to quarkus-cache extensions.