From 39a159e5ca1a4e489ac60b382d1dc8c0db766a94 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sun, 18 Feb 2024 12:58:06 +0800 Subject: [PATCH] Optimize CI caching policy --- .github/workflows/ci.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19fc41af1..5c537f0f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,6 @@ jobs: with: workspaces: "./app/src/main/rust" shared-key: ${{ runner.os }} - save-if: "false" - name: Rustfmt Check working-directory: ./app/src/main/rust @@ -66,11 +65,12 @@ jobs: with: workspaces: "./app/src/main/rust" shared-key: ${{ runner.os }} + save-if: "false" - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: true + gradle-home-cache-cleanup: true - name: CMake Cache uses: actions/cache@v4 @@ -78,8 +78,8 @@ jobs: path: | app/.cxx app/src/main/cpp/nettle/nettle - key: ${{ runner.os }}-cmake-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} - restore-keys: ${{ runner.os }}-cmake- + key: cmake-default-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} + restore-keys: cmake-default- - name: Install Build Tools run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "build-tools;35.0.0-rc1" @@ -156,8 +156,8 @@ jobs: path: | app/.cxx app/src/main/cpp/nettle/nettle - key: ${{ runner.os }}-cmake-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} - restore-keys: ${{ runner.os }}-cmake- + key: cmake-default-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} + restore-keys: cmake-default- - name: Install Build Tools run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "build-tools;35.0.0-rc1" @@ -221,11 +221,12 @@ jobs: with: workspaces: "./app/src/main/rust" shared-key: ${{ runner.os }} + save-if: "false" - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 with: - cache-read-only: true + gradle-home-cache-cleanup: true - name: CMake Cache uses: actions/cache@v4 @@ -233,8 +234,8 @@ jobs: path: | app/.cxx app/src/main/cpp/nettle/nettle - key: ${{ runner.os }}-cmake-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} - restore-keys: ${{ runner.os }}-cmake- + key: cmake-marshmallow-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} + restore-keys: cmake-marshmallow- - name: Install Build Tools run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "build-tools;35.0.0-rc1" @@ -311,8 +312,8 @@ jobs: path: | app/.cxx app/src/main/cpp/nettle/nettle - key: ${{ runner.os }}-cmake-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} - restore-keys: ${{ runner.os }}-cmake- + key: cmake-marshmallow-${{ hashFiles('gradle/libs.versions.toml', 'app/build.gradle.kts', 'app/src/main/cpp/CMakeLists.txt') }} + restore-keys: cmake-marshmallow- - name: Install Build Tools run: echo "y" | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "build-tools;35.0.0-rc1"