|
|
@@ -64,24 +64,35 @@ jobs:
|
|
|
echo "CONFIG=$CONFIG" >> $GITHUB_ENV
|
|
|
|
|
|
echo "CONFIG set to: $CONFIG"
|
|
|
-
|
|
|
- - name: Cache prebuilt toolchain
|
|
|
- id: cache-toolchain
|
|
|
+
|
|
|
+ - name: Set up cache for toolchain
|
|
|
uses: actions/cache@v4
|
|
|
+ id: cache-toolchain
|
|
|
with:
|
|
|
path: |
|
|
|
kernel-build-tools
|
|
|
mkbootimg
|
|
|
- key: toolchain-${{ runner.os }}-v1 # Use a fixed version key to ensure reusability
|
|
|
- restore-keys: toolchain-${{ runner.os }}-
|
|
|
-
|
|
|
- - name: Download prebuilt toolchain (if cache is missing)
|
|
|
+ key: toolchain-${{ runner.os }}-v1
|
|
|
+
|
|
|
+ - name: Restore prebuilt toolchain from cache (if available)
|
|
|
+ if: steps.cache-toolchain.outputs.cache-hit == 'true'
|
|
|
+ run: |
|
|
|
+ echo "Toolchain restored from cache."
|
|
|
+
|
|
|
+ - name: Use prebuilt toolchain (if cache is missing, download)
|
|
|
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
|
|
run: |
|
|
|
AOSP_MIRROR=https://android.googlesource.com
|
|
|
BRANCH=main-kernel-build-2024
|
|
|
- git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 kernel-build-tools
|
|
|
- git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1 mkbootimg
|
|
|
+ TEMP_DIR=$(mktemp -d)
|
|
|
+
|
|
|
+ git clone $AOSP_MIRROR/kernel/prebuilts/build-tools -b $BRANCH --depth 1 $TEMP_DIR/kernel-build-tools
|
|
|
+ git clone $AOSP_MIRROR/platform/system/tools/mkbootimg -b $BRANCH --depth 1 $TEMP_DIR/mkbootimg
|
|
|
+
|
|
|
+ mv $TEMP_DIR/kernel-build-tools ./kernel-build-tools
|
|
|
+ mv $TEMP_DIR/mkbootimg ./mkbootimg
|
|
|
+
|
|
|
+ rm -rf $TEMP_DIR
|
|
|
|
|
|
- name: Set environment variables
|
|
|
run: |
|