From 53bd94e0ee76570b9f90fef80e6f536824fae95a Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Mon, 14 Sep 2026 00:55:51 +0300 Subject: [PATCH] Cache full Gradle build directories in CI instead of ProGuard export only. Co-authored-by: Cursor --- .../actions/cache-desktop-proguard/action.yml | 18 --------------- .github/actions/cache-gradle-build/action.yml | 23 +++++++++++++++++++ .github/workflows/release.yml | 11 ++++++--- gradle.properties | 1 + 4 files changed, 32 insertions(+), 21 deletions(-) delete mode 100644 .github/actions/cache-desktop-proguard/action.yml create mode 100644 .github/actions/cache-gradle-build/action.yml diff --git a/.github/actions/cache-desktop-proguard/action.yml b/.github/actions/cache-desktop-proguard/action.yml deleted file mode 100644 index 01d7186..0000000 --- a/.github/actions/cache-desktop-proguard/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Cache desktop ProGuard jars -description: Restore or save the CI ProGuard export directory (speeds up release desktop-proguard job) - -outputs: - cache-hit: - description: Whether ProGuard jars were restored from cache - value: ${{ steps.cache.outputs.cache-hit }} - -runs: - using: composite - steps: - - uses: actions/cache@v5 - id: cache - with: - path: app/desktop/build/ci/proguard - key: desktop-proguard-v1-${{ hashFiles('gradle/libs.versions.toml', 'build.gradle.kts', 'settings.gradle.kts', 'app/desktop/build.gradle.kts', 'app/desktop/proguard-rules.pro', 'app/shared/build.gradle.kts') }} - restore-keys: | - desktop-proguard-v1- diff --git a/.github/actions/cache-gradle-build/action.yml b/.github/actions/cache-gradle-build/action.yml new file mode 100644 index 0000000..755293b --- /dev/null +++ b/.github/actions/cache-gradle-build/action.yml @@ -0,0 +1,23 @@ +name: Cache Gradle build directories +description: Restore or save module build/ trees for faster CI Gradle jobs + +outputs: + cache-hit: + description: Whether build directories were restored from cache + value: ${{ steps.cache.outputs.cache-hit }} + +runs: + using: composite + steps: + - uses: actions/cache@v5 + id: cache + with: + path: | + app/desktop/build + app/shared/build + app/android/build + utils/shared/build + utils/android/build + key: gradle-build-${{ runner.os }}-${{ runner.arch }}-v1-${{ hashFiles('gradle/libs.versions.toml', 'settings.gradle.kts', 'gradle.properties', '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 }}-v1- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9bda1a..6fafc6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,10 +84,10 @@ jobs: - uses: ./.github/actions/set-version with: version: ${{ needs.resolve-version.outputs.version }} - - uses: ./.github/actions/cache-desktop-proguard - id: proguard-cache + - uses: ./.github/actions/cache-gradle-build + id: gradle-build-cache - name: Compile and ProGuard release desktop jars - if: steps.proguard-cache.outputs.cache-hit != 'true' + if: steps.gradle-build-cache.outputs.cache-hit != 'true' run: ./gradlew :app:desktop:exportReleaseProguardForCi --no-daemon --console=plain - uses: actions/upload-artifact@v5 with: @@ -107,6 +107,7 @@ jobs: - uses: ./.github/actions/set-version with: version: ${{ needs.resolve-version.outputs.version }} + - uses: ./.github/actions/cache-gradle-build - uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc @@ -163,6 +164,7 @@ jobs: - uses: ./.github/actions/set-version with: version: ${{ needs.resolve-version.outputs.version }} + - uses: ./.github/actions/cache-gradle-build - uses: actions/download-artifact@v5 with: name: desktop-proguard @@ -218,6 +220,7 @@ jobs: - uses: ./.github/actions/set-version with: version: ${{ needs.resolve-version.outputs.version }} + - uses: ./.github/actions/cache-gradle-build - uses: actions/download-artifact@v5 with: name: desktop-proguard @@ -273,6 +276,7 @@ jobs: - uses: ./.github/actions/set-version with: version: ${{ needs.resolve-version.outputs.version }} + - uses: ./.github/actions/cache-gradle-build - uses: actions/download-artifact@v5 with: name: desktop-proguard @@ -315,6 +319,7 @@ jobs: - uses: ./.github/actions/set-version with: version: ${{ needs.resolve-version.outputs.version }} + - uses: ./.github/actions/cache-gradle-build - name: Cache Android SDK extras uses: actions/cache@v5 with: diff --git a/gradle.properties b/gradle.properties index e4833eb..83d5a64 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,5 +35,6 @@ android.r8.optimizedResourceShrinking=true android.bundle.enableNativeLibraryCompressionInApk=true # Configuration cache can surface noisy IDE/sync issues on some setups; turn on when stable. org.gradle.configuration-cache=false +org.gradle.caching=true # Windows CI hosts cannot run iOS simulator tests; suppress KMP disabled-target noise. kotlin.native.ignoreDisabledTargets=true \ No newline at end of file