mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-09-22 19:15:05 +03:00
Split Gradle build cache into restore/save steps so hits still refresh.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,25 +1,20 @@
|
|||||||
name: Cache Gradle build directories
|
name: Restore Gradle build directories
|
||||||
description: Restore or save module build/ trees for faster CI Gradle jobs
|
description: Restore module build/ trees for faster CI Gradle jobs
|
||||||
|
|
||||||
inputs:
|
|
||||||
save:
|
|
||||||
description: Save cache at job end. Use false on parallel jobs that share the same cache key.
|
|
||||||
required: false
|
|
||||||
default: "true"
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: Whether build directories were restored from cache
|
description: Whether an exact cache key match was restored
|
||||||
value: ${{ steps.cache.outputs.cache-hit }}
|
value: ${{ steps.cache.outputs.cache-hit }}
|
||||||
|
cache-primary-key:
|
||||||
|
description: Primary cache key to pass to the save action after the build
|
||||||
|
value: ${{ steps.cache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/cache@v5
|
- uses: actions/cache/restore@v5
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
lookup-only: ${{ inputs.save != 'true' }}
|
|
||||||
save-always: ${{ inputs.save == 'true' }}
|
|
||||||
path: |
|
path: |
|
||||||
app/desktop/build
|
app/desktop/build
|
||||||
app/shared/build
|
app/shared/build
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: Save Gradle build directories
|
||||||
|
description: Save module build/ trees after a Gradle build (always runs, even on cache hit)
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
primary-key:
|
||||||
|
description: cache-primary-key from cache-gradle-build restore step
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- uses: actions/cache/save@v5
|
||||||
|
with:
|
||||||
|
key: ${{ inputs.primary-key }}
|
||||||
|
path: |
|
||||||
|
app/desktop/build
|
||||||
|
app/shared/build
|
||||||
|
app/android/build
|
||||||
|
utils/shared/build
|
||||||
|
utils/android/build
|
||||||
@@ -85,10 +85,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ needs.resolve-version.outputs.version }}
|
version: ${{ needs.resolve-version.outputs.version }}
|
||||||
- uses: ./.github/actions/cache-gradle-build
|
- uses: ./.github/actions/cache-gradle-build
|
||||||
with:
|
id: gradle-build-cache
|
||||||
save: "true"
|
|
||||||
- name: Compile and ProGuard release desktop jars
|
- name: Compile and ProGuard release desktop jars
|
||||||
run: ./gradlew :app:desktop:exportReleaseProguardForCi --no-daemon --console=plain
|
run: ./gradlew :app:desktop:exportReleaseProguardForCi --no-daemon --console=plain
|
||||||
|
- uses: ./.github/actions/save-gradle-build-cache
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }}
|
||||||
- uses: actions/upload-artifact@v5
|
- uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: desktop-proguard
|
name: desktop-proguard
|
||||||
@@ -108,8 +111,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ needs.resolve-version.outputs.version }}
|
version: ${{ needs.resolve-version.outputs.version }}
|
||||||
- uses: ./.github/actions/cache-gradle-build
|
- uses: ./.github/actions/cache-gradle-build
|
||||||
with:
|
id: gradle-build-cache
|
||||||
save: "true"
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
targets: x86_64-pc-windows-msvc
|
targets: x86_64-pc-windows-msvc
|
||||||
@@ -134,6 +136,10 @@ jobs:
|
|||||||
path: app/desktop/windows-setup/target/release/*.exe
|
path: app/desktop/windows-setup/target/release/*.exe
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
- uses: ./.github/actions/save-gradle-build-cache
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
windows-package:
|
windows-package:
|
||||||
name: Windows (${{ matrix.label }})
|
name: Windows (${{ matrix.label }})
|
||||||
@@ -169,8 +175,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ needs.resolve-version.outputs.version }}
|
version: ${{ needs.resolve-version.outputs.version }}
|
||||||
- uses: ./.github/actions/cache-gradle-build
|
- uses: ./.github/actions/cache-gradle-build
|
||||||
with:
|
|
||||||
save: "false"
|
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: desktop-proguard
|
name: desktop-proguard
|
||||||
@@ -229,8 +233,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ needs.resolve-version.outputs.version }}
|
version: ${{ needs.resolve-version.outputs.version }}
|
||||||
- uses: ./.github/actions/cache-gradle-build
|
- uses: ./.github/actions/cache-gradle-build
|
||||||
with:
|
id: gradle-build-cache
|
||||||
save: ${{ matrix.arch == 'arm64' }}
|
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: desktop-proguard
|
name: desktop-proguard
|
||||||
@@ -262,6 +265,10 @@ jobs:
|
|||||||
name: macos-${{ matrix.arch }}
|
name: macos-${{ matrix.arch }}
|
||||||
path: app/desktop/build/distributions/release/*-macOS-${{ matrix.arch }}.dmg
|
path: app/desktop/build/distributions/release/*-macOS-${{ matrix.arch }}.dmg
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
- uses: ./.github/actions/save-gradle-build-cache
|
||||||
|
if: always() && matrix.arch == 'arm64'
|
||||||
|
with:
|
||||||
|
primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
name: Linux (${{ matrix.label }})
|
name: Linux (${{ matrix.label }})
|
||||||
@@ -289,8 +296,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ needs.resolve-version.outputs.version }}
|
version: ${{ needs.resolve-version.outputs.version }}
|
||||||
- uses: ./.github/actions/cache-gradle-build
|
- uses: ./.github/actions/cache-gradle-build
|
||||||
with:
|
id: gradle-build-cache
|
||||||
save: ${{ matrix.arch == 'arm64' }}
|
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: desktop-proguard
|
name: desktop-proguard
|
||||||
@@ -320,6 +326,10 @@ jobs:
|
|||||||
app/desktop/build/distributions/release/*-linux-${{ matrix.arch }}.rpm
|
app/desktop/build/distributions/release/*-linux-${{ matrix.arch }}.rpm
|
||||||
app/desktop/build/distributions/release/*-linux-${{ matrix.arch }}.AppImage
|
app/desktop/build/distributions/release/*-linux-${{ matrix.arch }}.AppImage
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
- uses: ./.github/actions/save-gradle-build-cache
|
||||||
|
if: always() && matrix.arch == 'arm64'
|
||||||
|
with:
|
||||||
|
primary-key: ${{ steps.gradle-build-cache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
android:
|
android:
|
||||||
name: Android
|
name: Android
|
||||||
@@ -334,8 +344,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: ${{ needs.resolve-version.outputs.version }}
|
version: ${{ needs.resolve-version.outputs.version }}
|
||||||
- uses: ./.github/actions/cache-gradle-build
|
- uses: ./.github/actions/cache-gradle-build
|
||||||
with:
|
|
||||||
save: "false"
|
|
||||||
- name: Cache Android SDK extras
|
- name: Cache Android SDK extras
|
||||||
uses: actions/cache@v5
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user