diff --git a/.github/actions/cache-gradle-build/action.yml b/.github/actions/cache-gradle-build/action.yml index ca2629f..12accb3 100644 --- a/.github/actions/cache-gradle-build/action.yml +++ b/.github/actions/cache-gradle-build/action.yml @@ -70,15 +70,16 @@ runs: if: inputs.scope != 'android' && inputs.scope != 'build-jar' id: cache with: - # Desktop packaging scopes never build Android and never run ProGuard — they stage the - # Build JAR artifact's jars instead — so their copy of compose/tmp is redundant and is not - # archived. Everything else here is either regenerated per version (distributions, the - # exported jars, the jpackage runtime image) or irrelevant (Android modules): archiving - # them is what pushed this repo past the 10 GB limit and into eviction. - # WARNING: the negations below are no-ops with actions/cache — included directories are - # tared whole and negated subtrees cannot be carved out (actions/toolkit#713). The real - # trim is done by not saving the packaging scopes at all (see save-gradle-build-cache); - # restore still falls back through the prefixes below to the build-jar scope. + # All non-android scopes must share ONE identical path list: actions/cache matches + # restore-keys only among entries with the same version stamp (a hash of the path + # list), so a build-jar entry can only warm a packaging job's restore if both lists + # are byte-identical. compose/tmp stays included everywhere: it holds ProGuard's + # output jars (~50-100 MB), which package jobs re-stage, and is small next to what + # a working cross-scope fallback saves in time. (Note: negations like + # "!app/desktop/build/distributions" are no-ops with actions/cache — included + # directories are tared whole and negated subtrees cannot be carved out, + # actions/toolkit#713; the real trim is done by not saving the packaging scopes at + # all, see save-gradle-build-cache.) path: | .gradle build @@ -88,7 +89,6 @@ runs: !app/desktop/build/distributions !app/desktop/build/ci !app/desktop/build/compose/binaries - !app/desktop/build/compose/tmp key: gradle-build-${{ runner.os }}-${{ runner.arch }}-v2-${{ inputs.scope }}-${{ hashFiles('gradle/libs.versions.toml', 'settings.gradle.kts', 'gradle.properties', 'build.gradle.kts', 'app/desktop/build.gradle.kts', 'app/desktop/proguard-rules.pro', 'app/shared/build.gradle.kts', 'app/android/build.gradle.kts', 'utils/shared/build.gradle.kts', 'utils/android/build.gradle.kts') }} restore-keys: | gradle-build-${{ runner.os }}-${{ runner.arch }}-v2-${{ inputs.scope }}- diff --git a/.github/actions/save-gradle-build-cache/action.yml b/.github/actions/save-gradle-build-cache/action.yml index 1a56c61..be97a61 100644 --- a/.github/actions/save-gradle-build-cache/action.yml +++ b/.github/actions/save-gradle-build-cache/action.yml @@ -59,6 +59,12 @@ runs: !startsWith(inputs.scope, 'linux-') && !startsWith(inputs.scope, 'windows-package-') && !startsWith(inputs.scope, 'macos-') + # Path list must stay byte-identical to the generic restore list in + # cache-gradle-build: actions/cache refuses to save when the restore and save + # paths differ, and the version stamp (hash of the path list) gates any later + # restore — including cross-scope restore-key fallbacks. compose/tmp is kept + # here on purpose (holds ProGuard's output jars; small); see the matching + # comment in cache-gradle-build. uses: actions/cache/save@v5 continue-on-error: true with: @@ -72,4 +78,3 @@ runs: !app/desktop/build/distributions !app/desktop/build/ci !app/desktop/build/compose/binaries - !app/desktop/build/compose/tmp