From fe1d609cfc18f294199c53c07387b23d5e1348e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 10:39:48 +0200 Subject: [PATCH 01/12] chore(ci): use the same ci-gradle.properties --- .github/actions/setup/action.yml | 2 +- .github/ci-gradle-android-pr-workflow.properties | 10 ---------- .github/ci-gradle.properties | 5 ++++- 3 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 .github/ci-gradle-android-pr-workflow.properties diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index f3446bfc3dd..96c0f1558a9 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -5,7 +5,7 @@ runs: steps: - name: Copy CI gradle.properties shell: bash - run: mkdir -p ~/.gradle ; cp .github/ci-gradle-android-pr-workflow.properties ~/.gradle/gradle.properties + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 diff --git a/.github/ci-gradle-android-pr-workflow.properties b/.github/ci-gradle-android-pr-workflow.properties deleted file mode 100644 index aa7bdba98be..00000000000 --- a/.github/ci-gradle-android-pr-workflow.properties +++ /dev/null @@ -1,10 +0,0 @@ -org.gradle.daemon=false -org.gradle.parallel=true -org.gradle.caching=true -org.gradle.configuration-cache=true -org.gradle.configuration-cache.parallel=true -org.gradle.workers.max=4 -org.gradle.jvmargs=-Xmx10g -XX:MaxMetaspaceSize=4g -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError - -kotlin.incremental=true -kotlin.compiler.execution.strategy=in-process diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties index 51c4e2f1d3f..ce414326caf 100644 --- a/.github/ci-gradle.properties +++ b/.github/ci-gradle.properties @@ -1,7 +1,10 @@ org.gradle.daemon=false org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configuration-cache=true +org.gradle.configuration-cache.parallel=true org.gradle.workers.max=4 -org.gradle.jvmargs=-Xmx10g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx10g -XX:MaxMetaspaceSize=4g -Dfile.encoding=UTF-8 -XX:+UseParallelGC kotlin.incremental=true kotlin.compiler.execution.strategy=in-process From 2c734ee57250e327cfd86a465b5fc078a42afd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 10:53:21 +0200 Subject: [PATCH 02/12] chore(ci): bump dependencies in composite workflows Maybe dependabot is not able to update these --- .github/actions/setup/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 96c0f1558a9..bec4151c9d3 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -8,13 +8,13 @@ runs: run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - name: Set up JDK - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 with: distribution: 'temurin' java-version: '21' - name: Set up Gradle - uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 + uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 - name: Restore Gradle cache uses: ./.github/actions/gradle_cache From 591bf716ffef0ddf7fb1d87a05c4b92d73c9d72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 11:21:58 +0200 Subject: [PATCH 03/12] chore(ci): add shared setup gradle --- .github/actions/setup-gradle/action.yml | 29 ++++++++++++++++++++++ .github/workflows/android.yml | 18 ++++++-------- .github/workflows/markdown.yml | 12 ++-------- .github/workflows/shippable_builds.yml | 32 +++++-------------------- 4 files changed, 44 insertions(+), 47 deletions(-) create mode 100644 .github/actions/setup-gradle/action.yml diff --git a/.github/actions/setup-gradle/action.yml b/.github/actions/setup-gradle/action.yml new file mode 100644 index 00000000000..15396a7c4af --- /dev/null +++ b/.github/actions/setup-gradle/action.yml @@ -0,0 +1,29 @@ +name: Set up Gradle build environment +description: Prepares environment for building with JDK and Gradle +inputs: + run-release: + description: 'Whether to run in release mode (true/false). In release mode, Gradle cache is not used.' + required: false + default: 'false' + add-job-summary: + description: 'Whether to add a job summary (always, never, on-failure).' + required: false + default: 'always' +runs: + using: 'composite' + steps: + - name: Copy CI gradle.properties + shell: bash + run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + + - name: Set up JDK + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + with: + distribution: 'temurin' + java-version: '21' + + - name: Set up Gradle without cache + uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 + with: + cache-disabled: ${{ inputs.run-release }} + add-job-summary: ${{ inputs.add-job-summary }} diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 734f1898f8a..85b92b76386 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -19,23 +19,19 @@ permissions: contents: read jobs: - build: + build-android: + name: Build Android application runs-on: ubuntu-latest timeout-minutes: 90 steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + - name: Checkout the repo + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: - distribution: 'temurin' - java-version: '21' + fetch-depth: 1 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Quality - Spotless run: ./gradlew spotlessCheck diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 1c0acd30279..18bf77b8d43 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -22,16 +22,8 @@ jobs: - name: Install mdbook and extensions run: ./docs/install.sh - - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - distribution: 'temurin' - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Quality - Spotless Markdown Check run: ./gradlew spotlessFlexmarkCheck diff --git a/.github/workflows/shippable_builds.yml b/.github/workflows/shippable_builds.yml index 8a40f3c36a8..0e5dbcaf80e 100644 --- a/.github/workflows/shippable_builds.yml +++ b/.github/workflows/shippable_builds.yml @@ -220,22 +220,11 @@ jobs: fetch-depth: 0 token: ${{ steps.app-token.outputs.token || github.token }} - - name: Copy CI gradle.properties - if: ${{ contains(matrix.releaseTarget, 'github') || needs.dump_config.outputs.releaseType == 'daily' }} - shell: bash - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - if: ${{ contains(matrix.releaseTarget, 'github') || needs.dump_config.outputs.releaseType == 'daily' }} - with: - distribution: 'temurin' - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 + - name: Setup Gradle environment if: ${{ contains(matrix.releaseTarget, 'github') || needs.dump_config.outputs.releaseType == 'daily' }} + uses: ./.github/actions/setup-gradle with: - cache-disabled: "${{ contains(fromJSON('[\"beta\", \"release\"]'), needs.dump_config.outputs.releaseType) }}" + run-release: "${{ contains(fromJSON('[\"beta\", \"release\"]'), needs.dump_config.outputs.releaseType) }}" add-job-summary: never - name: Get application info @@ -470,19 +459,10 @@ jobs: with: ref: ${{ steps.sha.outputs.app_sha }} - - name: Copy CI gradle.properties - shell: bash - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - distribution: 'temurin' - java-version: '21' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle with: - cache-disabled: "${{ contains(fromJSON('[\"beta\", \"release\"]'), needs.dump_config.outputs.releaseType) }}" + run-release: "${{ contains(fromJSON('[\"beta\", \"release\"]'), needs.dump_config.outputs.releaseType) }}" add-job-summary: on-failure - name: Set Version Code for Daily From 0a87070cfe2a936cfe94d708eb3cd5eba55543a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 12:05:18 +0200 Subject: [PATCH 04/12] chore(ci): add concurrency cancelation --- .github/workflows/android.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 85b92b76386..895a5d00640 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -18,6 +18,10 @@ on: permissions: contents: read +concurrency: + group: android-ci-${{ github.ref }}-${{ github.event.pull_request.number || 'no-pr' }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: build-android: name: Build Android application From a0683c37cb15797462a8acb1f50b2beddf030a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 12:14:58 +0200 Subject: [PATCH 05/12] chore(ci): rename android to build-android --- .github/workflows/{android.yml => build-android.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{android.yml => build-android.yml} (100%) diff --git a/.github/workflows/android.yml b/.github/workflows/build-android.yml similarity index 100% rename from .github/workflows/android.yml rename to .github/workflows/build-android.yml From c8e525aa774af74c25888244c2754b459eae9394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 12:41:06 +0200 Subject: [PATCH 06/12] chore(ci): fix dependabot to update composite actions --- .github/dependabot.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9206ebd8427..4d634ef05c9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,11 @@ version: 2 updates: + # Dependabot does not support GitHub composite actions by default (.github/actions) + # so we need to add the folder by hand to the directories entry. - package-ecosystem: "github-actions" - directory: "/" + directories: + - "/" + - "/.github/actions/*" schedule: interval: "weekly" labels: From 4f8339f4f23cfd64a2298abb63011de14e0676db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 12:45:33 +0200 Subject: [PATCH 07/12] chore(ci): show disk usage --- .github/actions/disk-usage/action.yml | 24 ++++++++++++++++++++++++ .github/workflows/build-android.yml | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/actions/disk-usage/action.yml diff --git a/.github/actions/disk-usage/action.yml b/.github/actions/disk-usage/action.yml new file mode 100644 index 00000000000..e146b8bdb16 --- /dev/null +++ b/.github/actions/disk-usage/action.yml @@ -0,0 +1,24 @@ +name: Disk usage +description: Show disk usage +runs: + using: 'composite' + steps: + - name: Total runner disk usage + shell: bash + run: df -h / + + - name: Workspace usage + shell: bash + run: du -sh $GITHUB_WORKSPACE || true + + - name: Gradle user home usage + shell: bash + run: du -sh ~/.gradle || true + + - name: Gradle cache usage + shell: bash + run: du -sh ~/.gradle/caches || true + + - name: Build outputs usage + shell: bash + run: du -sh build app-*/build || true diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 895a5d00640..3abb5086e8b 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -37,6 +37,9 @@ jobs: - name: Setup Gradle environment uses: ./.github/actions/setup-gradle + - name: Show disk usage + uses: ./.github/actions/disk-usage + - name: Quality - Spotless run: ./gradlew spotlessCheck @@ -46,8 +49,16 @@ jobs: - name: Quality - Lint run: ./gradlew lint + - name: Show disk usage + uses: ./.github/actions/disk-usage + - name: Quality - Dependency Guard run: ./gradlew dependencyGuard - name: Build (run full build and tests) run: ./gradlew build + + - name: Show disk usage + uses: ./.github/actions/disk-usage + + From 0727a1692d71572cec52dc59c5bfffbcdd846d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 14:22:08 +0200 Subject: [PATCH 08/12] chore(ci): add disk cleanup action --- .github/actions/disk-cleanup/action.yml | 37 +++++++++++++++++++++++++ .github/workflows/build-android.yml | 6 ++++ 2 files changed, 43 insertions(+) create mode 100644 .github/actions/disk-cleanup/action.yml diff --git a/.github/actions/disk-cleanup/action.yml b/.github/actions/disk-cleanup/action.yml new file mode 100644 index 00000000000..862cfd95c92 --- /dev/null +++ b/.github/actions/disk-cleanup/action.yml @@ -0,0 +1,37 @@ +name: Disk cleanup +description: Clean up disk space by removing unnecessary files +runs: + using: 'composite' + steps: + - name: Clean up unnecessary files + shell: bash + run: | + # Remove Java JDKs + sudo rm -rf /usr/lib/jvm + + # Remove .NET SDKs + sudo rm -rf /usr/share/dotnet + + # Remove Swift toolchain + sudo rm -rf /usr/share/swift + + # Remove Haskell (GHC) + sudo rm -rf /usr/local/.ghcup + + # Remove Julia + sudo rm -rf /usr/local/julia* + + # Remove Chromium (optional if not using for browser tests) + sudo rm -rf /usr/local/share/chromium + + # Remove Microsoft/Edge and Google Chrome builds + sudo rm -rf /opt/microsoft /opt/google + + # Remove Azure CLI + sudo rm -rf /opt/az + + # Remove PowerShell + sudo rm -rf /usr/local/share/powershell + + # Remove toolcaches + sudo rm -rf /opt/hostedtoolcache diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 3abb5086e8b..45ea5f0edef 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -34,6 +34,12 @@ jobs: with: fetch-depth: 1 + - name: Show disk usage + uses: ./.github/actions/disk-usage + + - name: Cleanup disk + uses: ./.github/actions/disk-cleanup + - name: Setup Gradle environment uses: ./.github/actions/setup-gradle From ece66649e085c0e14c755fd42055ed6ad4d0037e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 15:45:45 +0200 Subject: [PATCH 09/12] fix: add missing foojay-resolver and limit it to JvmVendorSpec.ADOPTIUM --- quality/konsist/build.gradle.kts | 5 ++++- settings.gradle.kts | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/quality/konsist/build.gradle.kts b/quality/konsist/build.gradle.kts index a9e018eeb37..6ea5a85ce68 100644 --- a/quality/konsist/build.gradle.kts +++ b/quality/konsist/build.gradle.kts @@ -3,7 +3,10 @@ plugins { } kotlin { - jvmToolchain(11) + jvmToolchain { + languageVersion = JavaLanguageVersion.of(11) + vendor = JvmVendorSpec.ADOPTIUM + } } dependencies { diff --git a/settings.gradle.kts b/settings.gradle.kts index 0e3a5216475..962b12f3974 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,10 @@ pluginManagement { } } +plugins { + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" +} + dependencyResolutionManagement { repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS repositories { From 13d70c8b610bb54414d39af0c322617681dd3df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 15:46:16 +0200 Subject: [PATCH 10/12] chore(ci): enable Gradle daemon --- .github/ci-gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties index ce414326caf..d329ec204a9 100644 --- a/.github/ci-gradle.properties +++ b/.github/ci-gradle.properties @@ -1,4 +1,4 @@ -org.gradle.daemon=false +org.gradle.daemon=true org.gradle.parallel=true org.gradle.caching=true org.gradle.configuration-cache=true From dcd75084b989d4bacf2d3d578484a53ab68a2e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 16:14:41 +0200 Subject: [PATCH 11/12] chore(ci): only use the setup-gradle action and avoid writing caches from pull-requests Treats PR runs as read-only, so PRs can't write and potentially poison caches --- .github/actions/gradle_cache/action.yml | 14 --------- .github/actions/setup/action.yml | 20 ------------- .github/workflows/android-pr.yml | 40 ++++++++++++------------- 3 files changed, 20 insertions(+), 54 deletions(-) delete mode 100644 .github/actions/gradle_cache/action.yml delete mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/gradle_cache/action.yml b/.github/actions/gradle_cache/action.yml deleted file mode 100644 index 58464b51132..00000000000 --- a/.github/actions/gradle_cache/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Gradle cache -description: Enable Gradle Wrapper caching (optimization) -runs: - using: 'composite' - steps: - - name: Enable Gradle Wrapper caching - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # 4.2.4 - with: - path: - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index bec4151c9d3..00000000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Set up build environment -description: Prepares environment for building with JDK and Gradle -runs: - using: 'composite' - steps: - - name: Copy CI gradle.properties - shell: bash - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties - - - name: Set up JDK - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - distribution: 'temurin' - java-version: '21' - - - name: Set up Gradle - uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 - - - name: Restore Gradle cache - uses: ./.github/actions/gradle_cache diff --git a/.github/workflows/android-pr.yml b/.github/workflows/android-pr.yml index 594266fe9d8..281042c9865 100644 --- a/.github/workflows/android-pr.yml +++ b/.github/workflows/android-pr.yml @@ -30,8 +30,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Build K9 application run: ./gradlew :app-k9mail:assemble @@ -44,8 +44,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Build Thunderbird application run: ./gradlew :app-thunderbird:assemble @@ -58,8 +58,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Build App UI-catalog application in Debug mode run: ./gradlew :app-ui-catalog:assembleDebug @@ -81,9 +81,9 @@ jobs: if: steps.changes.outputs.cli_tools_changed == 'true' uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment + - name: Setup Gradle environment if: steps.changes.outputs.cli_tools_changed == 'true' - uses: ./.github/actions/setup + uses: ./.github/actions/setup-gradle - name: Build CLI tools # run only if CLI tools were changed @@ -98,8 +98,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Running Android lint run: ./gradlew lint @@ -112,8 +112,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Running spotless check run: ./gradlew spotlessCheck @@ -126,8 +126,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Running Detekt run: ./gradlew detekt @@ -149,8 +149,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Running unit tests run: ./gradlew testsOnCi --parallel @@ -163,8 +163,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Running Dependency Guard run: ./gradlew dependencyGuard @@ -177,8 +177,8 @@ jobs: - name: Checkout the repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Prepares environment - uses: ./.github/actions/setup + - name: Setup Gradle environment + uses: ./.github/actions/setup-gradle - name: Running K9 Badging run: | From cbc549c8b093dd6b05d1cea1589b1f26b8c378ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolf-Martell=20Montw=C3=A9?= Date: Wed, 1 Oct 2025 16:31:25 +0200 Subject: [PATCH 12/12] chore(ci): only allow one workflow to write the cache --- .github/actions/setup-gradle/action.yml | 5 +++++ .github/workflows/build-android.yml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/.github/actions/setup-gradle/action.yml b/.github/actions/setup-gradle/action.yml index 15396a7c4af..53f19675878 100644 --- a/.github/actions/setup-gradle/action.yml +++ b/.github/actions/setup-gradle/action.yml @@ -9,6 +9,10 @@ inputs: description: 'Whether to add a job summary (always, never, on-failure).' required: false default: 'always' + write-cache: + description: 'Whether to write to the cache (true/false).' + required: false + default: 'false' runs: using: 'composite' steps: @@ -27,3 +31,4 @@ runs: with: cache-disabled: ${{ inputs.run-release }} add-job-summary: ${{ inputs.add-job-summary }} + cache-read-only: ${{ inputs.write-cache == 'false' || inputs.run-release == 'true' }} diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 45ea5f0edef..78b16f34837 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -42,6 +42,8 @@ jobs: - name: Setup Gradle environment uses: ./.github/actions/setup-gradle + with: + write-cache: ${{ github.ref == 'refs/heads/main' }} - name: Show disk usage uses: ./.github/actions/disk-usage