CI: build: add option to define custom ccache cache type
[openwrt/staging/nbd.git] / .github / workflows / build.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'