Skip to content

Gradle Build Cache

Avrea provides a build cache endpoint for Gradle. Build outputs are cached so that tasks with unchanged inputs are never re-executed.

Gradle is pre-configured via ~/.gradle/init.gradle:

~/.gradle/init.gradle
gradle.settingsEvaluated { settings ->
settings.buildCache {
remote(HttpBuildCache) {
url = uri("http://cache.avrea.com:8290/gradle-build/cas/")
push = true
allowInsecureProtocol = true
}
}
}

Your workflow needs no changes to point at Avrea. Just make sure the Gradle build cache is enabled (--build-cache flag or org.gradle.caching=true in gradle.properties):

workflow.yml
jobs:
build:
runs-on: avrea-ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: '21'
- run: ./gradlew build --build-cache

Add to your project settings.gradle:

settings.gradle
// settings.gradle
buildCache {
remote(HttpBuildCache) {
url = uri("http://cache.avrea.com:8290/gradle-build/cas/")
push = true
allowInsecureProtocol = true
}
}

Then enable it in your workflow:

- run: ./gradlew build --build-cache

The --build-cache flag enables the remote build cache. You can also set org.gradle.caching=true in gradle.properties to enable it by default.

On Linux and macOS runners, Gradle 8.1.1 and later reports aggregate task outcomes and selected task details alongside Gradle cache traffic. The detailed list is bounded and prioritizes failed and slower tasks; aggregate counts cover every observed task. See Cache Stats for the outcome definitions, limits, and coverage states.