Skip to content

feat(ci): serve the Gradle build cache from RunsOn - #44

Merged
hbrombeer merged 1 commit into
mainfrom
runs-on-cache
Nov 6, 2026
Merged

hbrombeer merged 1 commit into
mainfrom
runs-on-cache

Conversation

@hbrombeer

Copy link
Copy Markdown
Member

Pull Request

Description

Serves Gradle's HTTP build cache from RunsOn's S3 bucket (RunsOn v3.6.0, remote_cache: gradle on runs-on/action@v2) in gradle-ci, gradle-publish and the test step of native-gradle-build-push. Gradle only uses a remote cache with the build cache on, so these steps now pass --build-cache.

docker-gradle-build-push and platform-test-preview are unchanged: Gradle runs inside the Docker build there, which cannot reach the runner's agent, and they keep the sticky BuildKit cache.

Type of Change

  • ✨ New feature

Testing

  • Unit tests pass (python -m unittest discover -s tests, 20 tests)
  • Manual testing completed: open until the stack runs v3.6.0
  • New tests added for new functionality

All Gradle repos use 9.2.1 or newer; the cache needs 7.6.

Risk

This changes CI for every Gradle repo as soon as it is on main, because callers use @main.

  • --build-cache is new for repos without org.gradle.caching=true: unchanged inputs now restore a task's output, including test. A test with undeclared inputs (an external service, an environment value) would be skipped instead of re-run.
  • The stack is on v3.5.0. Until it is upgraded, the action warns and builds run with the local build cache only.
  • On public repos the action step is skipped, and --build-cache uses the local cache.

Branch scoping: a pull request reads its own entries, its base and the default branch, and writes only its own. Entries expire after 10 days.

How to revert

git revert is enough. Entries left in the bucket expire on their own.

RunsOn v3.6.0 serves Gradle's HTTP build cache from the stack's S3 bucket
through runs-on/action. Gradle only uses it with the build cache on, so the
Gradle steps pass --build-cache. On an older stack the action warns and the
build runs without the remote cache.
@hbrombeer
hbrombeer marked this pull request as ready for review November 6, 2026 10:25
@hbrombeer
hbrombeer merged commit d48d9f6 into main Nov 6, 2026
3 checks passed
@hbrombeer
hbrombeer deleted the runs-on-cache branch November 6, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant