CI: build: add option to define custom ccache cache type
authorChristian Marangi <ansuelsmth@gmail.com>
Sun, 28 May 2023 01:12:54 +0000 (03:12 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 24 Oct 2023 15:12:04 +0000 (17:12 +0200)
Add new input to define custom ccache cache type. This is useful to use
a different ccache cache for some special workflow that may do more test
than simple kernel compilation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 07b52a8a25f261e3cee03f4980e4bc868e9ee5cc)

.github/workflows/build.yml
.github/workflows/packages.yml

index 27ed5cc218e370e54a14488161a173e1f971d2f9..0fbeb5b0f5e517a4b7bba3d373d26e282c295f7f 100644 (file)
@@ -57,6 +57,9 @@ on:
       use_ccache_cache:
         type: boolean
         default: true
+      ccache_type:
+        type: string
+        default: kernel
 
 permissions:
   contents: read
@@ -257,9 +260,9 @@ jobs:
         uses: actions/cache/restore@v3
         with:
           path: openwrt/.ccache
-          key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }}
+          key: ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }}
           restore-keys: |
-            ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-
+            ccache-${{ inputs.ccache_type }}-${{ inputs.target }}/${{ inputs.subtarget }}-
 
       - name: Download external toolchain/sdk
         if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type != 'internal' && steps.parse-toolchain.outputs.toolchain-type != 'external_container'
index 8ab07f1f073c7ef1ac042dca013ceb437e374e45..58bbcd01311275b5c89ed92271abc82498de7caa 100644 (file)
@@ -53,4 +53,5 @@ jobs:
       build_all_kmods: true
       build_all_modules: true
       build_full: true
+      ccache_type: packages