Просмотр исходного кода

Refactor GitHub Actions for Cache Management and Build Environment

- Removed redundant disk usage display steps from the build workflow.
- Updated the Free Disk Space action to be conditionally executed.
- Consolidated cache setup and restoration into dedicated actions for better maintainability.
- Introduced new actions for cache saving and restoring, supporting multiple paths and keys.
- Enhanced cache statistics reporting with a dedicated action.
- Updated .gitignore to exclude kernel manifests.
- Improved ccache and Bazel cache setup logic based on kernel and Android versions.
- Added support for ld cache setup in the build environment.

Co-authored-by: Copilot <copilot@github.com>
TheWildJames 4 месяцев назад
Родитель
Сommit
55b244d79a

+ 2 - 1
.github/actions/build-kernel/action.yml

@@ -27,8 +27,9 @@ runs:
       else
         cp "$GITHUB_WORKSPACE/wild_gki.fragment" common/arch/arm64/configs/wild_gki.fragment
         tools/bazel build \
+          --linkopt="--thinlto-cache-dir=/home/runner/.ld_cache" \
           --config=fast \
           --defconfig_fragment=//common:arch/arm64/configs/wild_gki.fragment \
-          --disk_cache="$BAZEL_DISK_CACHE_DIR" \
+          --disk_cache="$BAZEL_CACHE_DIR" \
           //common:kernel_aarch64
       fi

+ 107 - 42
.github/actions/restore-cache/action.yml → .github/actions/cache-restore/action.yml

@@ -1,24 +1,39 @@
 name: 'Restore Cache'
-description: 'Restores cache from GitHub Releases based on provided keys and bucket'
+description: 'Restores cache from GitHub Releases. Supports both single and multiple cache paths/keys/buckets.'
 
 inputs:
   cache_path:
-    description: 'Path where cache should be restored'
-    required: true
+    description: 'Single path where cache should be restored (use cache_paths for multiple)'
+    required: false
+    type: string
+  cache_paths:
+    description: 'Multiline list of paths where caches should be restored (one per line)'
+    required: false
     type: string
+    default: ""
   cache_key:
-    description: 'Primary key to restore cache'
-    required: true
+    description: 'Primary key to restore cache (use cache_keys for multiple)'
+    required: false
     type: string
+  cache_keys:
+    description: 'Multiline list of primary keys to restore caches (one per line, must match cache_paths)'
+    required: false
+    type: string
+    default: ""
   restore_keys:
     description: 'Multiline list of keys (fallback prefixes)'
     required: false
     type: string
     default: ""
   cache_bucket:
-    description: 'The tag name for the release (e.g., general-cache)'
-    required: true
+    description: 'Single tag name for the release (use cache_buckets for multiple)'
+    required: false
     default: 'general-cache'
+  cache_buckets:
+    description: 'Multiline list of tag names for releases (one per line, must match cache_paths)'
+    required: false
+    type: string
+    default: ""
   compression_level:
     description: 'Compression level (0-9). 0 = No compression, 1 = Fast, 19 = Best.'
     required: false
@@ -27,13 +42,13 @@ inputs:
 
 outputs:
   cache-hit:
-    description: 'Returns "true" if cache was found and restored, "false" otherwise'
+    description: 'Returns "true" if at least one cache was found and restored, "false" otherwise'
     value: ${{ steps.restore.outputs.cache-hit }}
   cache-key:
-    description: 'The key that matched (primary or fallback)'
+    description: 'The key that matched (primary or fallback). Multiple entries joined by comma.'
     value: ${{ steps.restore.outputs.cache-key }}
   cache-size:
-    description: 'Size of restored cache in human-readable format'
+    description: 'Size of restored cache in human-readable format. Multiple entries joined by comma.'
     value: ${{ steps.restore.outputs.cache-size }}
 
 runs:
@@ -46,9 +61,32 @@ runs:
       env:
         TARGET_REPO: "${{ github.repository }}"
       run: |
-        TAG_NAME="${{ inputs.cache_bucket }}"
-        BASE_URL="https://github.com/${TARGET_REPO}/releases/download/$TAG_NAME"
-        ASSETS_URL="https://github.com/${TARGET_REPO}/releases/expanded_assets/$TAG_NAME"
+        # Validate and parse inputs
+        PATHS_INPUT="${{ inputs.cache_paths }}"
+        KEYS_INPUT="${{ inputs.cache_keys }}"
+        BUCKETS_INPUT="${{ inputs.cache_buckets }}"
+        
+        # If multiple inputs are empty, fall back to single inputs
+        if [ -z "$PATHS_INPUT" ]; then
+          PATHS_INPUT="${{ inputs.cache_path }}"
+        fi
+        if [ -z "$KEYS_INPUT" ]; then
+          KEYS_INPUT="${{ inputs.cache_key }}"
+        fi
+        if [ -z "$BUCKETS_INPUT" ]; then
+          BUCKETS_INPUT="${{ inputs.cache_bucket }}"
+        fi
+        
+        # Split inputs into arrays
+        IFS=$'\n' read -rd '' -a PATHS_ARRAY <<<"$PATHS_INPUT" || true
+        IFS=$'\n' read -rd '' -a KEYS_ARRAY <<<"$KEYS_INPUT" || true
+        IFS=$'\n' read -rd '' -a BUCKETS_ARRAY <<<"$BUCKETS_INPUT" || true
+        
+        # Validate array lengths match
+        if [[ ${#PATHS_ARRAY[@]} -ne ${#KEYS_ARRAY[@]} ]] || [[ ${#PATHS_ARRAY[@]} -ne ${#BUCKETS_ARRAY[@]} ]]; then
+          echo "::error::Mismatch in array lengths: paths=${#PATHS_ARRAY[@]}, keys=${#KEYS_ARRAY[@]}, buckets=${#BUCKETS_ARRAY[@]}"
+          exit 1
+        fi
         
         ARIA2_OPTS=(
           "-x16" "-s16" "-k1M" "-j5" "--file-allocation=none"
@@ -59,30 +97,49 @@ runs:
         
         ARIA2_OPTS+=("--quiet" "--summary-interval=0" "--console-log-level=error")
         
-        echo "::group:: Fetching Asset List"
-        HTTP_RESPONSE=$(curl -sL -A "Mozilla/5.0" -w "%{http_code}" "$ASSETS_URL" -o assets.html || echo "404")
+        # Collect results
+        OVERALL_HIT=false
+        MATCHED_KEYS=()
+        CACHE_SIZES=()
         
-        if [ "$HTTP_RESPONSE" -eq 200 ]; then
-          ALL_ASSETS=$(grep -oP "download/$TAG_NAME/\K[^\"' ]+" assets.html | sort -u || echo "")
-        else
-          echo "Status $HTTP_RESPONSE: Failed to fetch assets from scraper endpoint."
-          ALL_ASSETS=""
-        fi
-        rm -f assets.html
-        
-        if [ -z "$ALL_ASSETS" ]; then
-          echo "No assets found in bucket '$TAG_NAME'. Skipping search."
-          echo "::endgroup::"
-        else
+        # Process each cache entry
+        for ((idx=0; idx<${#PATHS_ARRAY[@]}; idx++)); do
+          CACHE_PATH="${PATHS_ARRAY[$idx]}"
+          CACHE_KEY="${KEYS_ARRAY[$idx]}"
+          CACHE_BUCKET="${BUCKETS_ARRAY[$idx]}"
+          
+          [ -z "$CACHE_PATH" ] && continue
+          
+          TAG_NAME="$CACHE_BUCKET"
+          BASE_URL="https://github.com/${TARGET_REPO}/releases/download/$TAG_NAME"
+          ASSETS_URL="https://github.com/${TARGET_REPO}/releases/expanded_assets/$TAG_NAME"
+          
+          echo "::group:: [$((idx+1))/$${#PATHS_ARRAY[@]}] Cache: $CACHE_BUCKET - Fetching Asset List"
+          HTTP_RESPONSE=$(curl -sL -A "Mozilla/5.0" -w "%{http_code}" "$ASSETS_URL" -o assets.html || echo "404")
+          
+          if [ "$HTTP_RESPONSE" -eq 200 ]; then
+            ALL_ASSETS=$(grep -oP "download/$TAG_NAME/\K[^\"' ]+" assets.html | sort -u || echo "")
+          else
+            echo "Status $HTTP_RESPONSE: Failed to fetch assets from scraper endpoint."
+            ALL_ASSETS=""
+          fi
+          rm -f assets.html
+          
+          if [ -z "$ALL_ASSETS" ]; then
+            echo "No assets found in bucket '$TAG_NAME'. Skipping."
+            echo "::endgroup::"
+            continue
+          fi
+          
           echo "Successfully fetched asset list. Has $(echo "$ALL_ASSETS" | wc -l) assets."
           echo "::endgroup::"
           
-          SEARCH_LIST=$(printf "%s\n%s" "${{ inputs.cache_key }}" "${{ inputs.restore_keys }}" | sed '/^$/d')
+          SEARCH_LIST=$(printf "%s\n%s" "$CACHE_KEY" "${{ inputs.restore_keys }}" | sed '/^$/d')
           
           FOUND=false
           while read -r KEY; do
             [ -z "$KEY" ] && continue
-            echo "::group:: Searching Prefix: $KEY"
+            echo "::group:: [$((idx+1))/$${#PATHS_ARRAY[@]}] Searching Prefix: $KEY"
             
             MATCH=$(echo "$ALL_ASSETS" | grep "^cache-$KEY" | sort -r | head -n 1 || true)
             
@@ -102,7 +159,7 @@ runs:
             echo "✅ Hit! Restoring $BASE_FILENAME$EXT"
             echo "::endgroup::"
             
-            echo "::group:: Downloading Cache"
+            echo "::group:: [$((idx+1))/$${#PATHS_ARRAY[@]}] Downloading Cache"
             
             download_asset() {
               local filename="$1"
@@ -142,10 +199,10 @@ runs:
             fi
             echo "::endgroup::"
             
-            echo "::group:: Extracting Cache"
-            mkdir -p "${{ inputs.cache_path }}"
+            echo "::group:: [$((idx+1))/$${#PATHS_ARRAY[@]}] Extracting Cache"
+            mkdir -p "$CACHE_PATH"
             FINAL_ARCHIVE="$BASE_FILENAME$EXT"
-            EXTRACT_DIR="$(dirname "${{ inputs.cache_path }}")"
+            EXTRACT_DIR="$(dirname "$CACHE_PATH")"
             
             extract_cache() {
               local cmd="$1"
@@ -171,18 +228,26 @@ runs:
             echo "✅ Restore complete."
             echo "::endgroup::"
             
-            # Output cache hit information
-            CACHE_SIZE=$(du -sh "${{ inputs.cache_path }}" 2>/dev/null | awk '{print $1}' || echo "unknown")
-            echo "cache-hit=true" >> $GITHUB_OUTPUT
-            echo "cache-key=$KEY" >> $GITHUB_OUTPUT
-            echo "cache-size=$CACHE_SIZE" >> $GITHUB_OUTPUT
+            # Track results for this entry
+            OVERALL_HIT=true
+            MATCHED_KEYS+=("$KEY")
+            CACHE_SIZE=$(du -sh "$CACHE_PATH" 2>/dev/null | awk '{print $1}' || echo "unknown")
+            CACHE_SIZES+=("$CACHE_SIZE")
             break
           done <<< "$SEARCH_LIST"
           
           if [ "$FOUND" = "false" ]; then
-              echo "⚠️ No cache matches found. Proceeding with fresh run."
-              echo "cache-hit=false" >> $GITHUB_OUTPUT
-              echo "cache-key=none" >> $GITHUB_OUTPUT
-              echo "cache-size=0B" >> $GITHUB_OUTPUT
+              echo "⚠️ No cache matches found for bucket '$CACHE_BUCKET'. Proceeding with fresh run."
+              MATCHED_KEYS+=("none")
+              CACHE_SIZES+=("0B")
           fi
+        done
+        
+        # Output results
+        if [ "$OVERALL_HIT" = "true" ]; then
+          echo "cache-hit=true" >> $GITHUB_OUTPUT
+        else
+          echo "cache-hit=false" >> $GITHUB_OUTPUT
         fi
+        echo "cache-key=$(IFS=,; echo "${MATCHED_KEYS[*]}")" >> $GITHUB_OUTPUT
+        echo "cache-size=$(IFS=,; echo "${CACHE_SIZES[*]}")" >> $GITHUB_OUTPUT

+ 185 - 0
.github/actions/cache-save/action.yml

@@ -0,0 +1,185 @@
+name: 'Save Cache'
+description: 'Archives and uploads cache to GitHub Releases. Supports both single and multiple cache paths/keys/buckets.'
+
+inputs:
+  cache_path:
+    description: 'Single path where cache is saved (use cache_paths for multiple)'
+    required: false
+    type: string
+  cache_paths:
+    description: 'Multiline list of paths where caches are saved (one per line)'
+    required: false
+    type: string
+    default: ""
+  cache_key:
+    description: 'Unique key for the cache (use cache_keys for multiple)'
+    required: false
+    type: string
+  cache_keys:
+    description: 'Multiline list of unique keys for caches (one per line, must match cache_paths)'
+    required: false
+    type: string
+    default: ""
+  cache_bucket:
+    description: 'Single tag name for the release (use cache_buckets for multiple)'
+    required: false
+    default: 'general-cache'
+  cache_buckets:
+    description: 'Multiline list of tag names for releases (one per line, must match cache_paths)'
+    required: false
+    type: string
+    default: ""
+  compression_level:
+    description: 'Compression level (0-9). 0 = No compression, 1 = Fast, 19 = Best.'
+    required: false
+    type: number
+    default: 6
+  github_token:
+    description: 'GitHub token for release upload authentication'
+    required: true
+    type: string
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Archive, Split, and Upload Cache
+      shell: bash
+      env:
+        GITHUB_TOKEN: ${{ inputs.github_token }}
+        TARGET_REPO: "${{ github.repository }}"
+      run: |
+        # Validate and parse inputs
+        PATHS_INPUT="${{ inputs.cache_paths }}"
+        KEYS_INPUT="${{ inputs.cache_keys }}"
+        BUCKETS_INPUT="${{ inputs.cache_buckets }}"
+        
+        # If multiple inputs are empty, fall back to single inputs
+        if [ -z "$PATHS_INPUT" ]; then
+          PATHS_INPUT="${{ inputs.cache_path }}"
+        fi
+        if [ -z "$KEYS_INPUT" ]; then
+          KEYS_INPUT="${{ inputs.cache_key }}"
+        fi
+        if [ -z "$BUCKETS_INPUT" ]; then
+          BUCKETS_INPUT="${{ inputs.cache_bucket }}"
+        fi
+        
+        # Split inputs into arrays
+        IFS=$'\n' read -rd '' -a PATHS_ARRAY <<<"$PATHS_INPUT" || true
+        IFS=$'\n' read -rd '' -a KEYS_ARRAY <<<"$KEYS_INPUT" || true
+        IFS=$'\n' read -rd '' -a BUCKETS_ARRAY <<<"$BUCKETS_INPUT" || true
+        
+        # Validate array lengths match
+        if [[ ${#PATHS_ARRAY[@]} -ne ${#KEYS_ARRAY[@]} ]] || [[ ${#PATHS_ARRAY[@]} -ne ${#BUCKETS_ARRAY[@]} ]]; then
+          echo "::error::Mismatch in array lengths: paths=${#PATHS_ARRAY[@]}, keys=${#KEYS_ARRAY[@]}, buckets=${#BUCKETS_ARRAY[@]}"
+          exit 1
+        fi
+        
+        # Git configuration for releases
+        git config user.name "github-actions[bot]"
+        git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+        
+        # Helper function to handle release creation
+        ensure_release() {
+          local tag_name="$1"
+          
+          git fetch --tags --force
+          
+          if ! git rev-parse "$tag_name" >/dev/null 2>&1; then
+            echo "Tag '$tag_name' not found. Creating backdated release..."
+            GIT_COMMITTER_DATE="2015-01-01T12:00:00" git tag -a "$tag_name" -m "Build Cache Storage"
+            if git push origin "$tag_name" --force; then
+              gh release create "$tag_name" --title "Build Cache" --notes "Automated storage for build assets" --repo "$TARGET_REPO" || true
+            else
+              echo "Push failed, tag might have been created by a parallel job. Continuing..."
+            fi
+          else
+            echo "Release '$tag_name' already exists. Ready for upload."
+          fi
+        }
+        
+        upload_with_retry() {
+          local file=$1
+          local tag_name=$2
+          local max_attempts=3
+          for ((i=1; i<=max_attempts; i++)); do
+            echo "  Attempt $i for $file..."
+            
+            if timeout 10m gh release upload "$tag_name" "$file" --clobber --repo "$TARGET_REPO" > /dev/null 2>&1; then
+              echo "  Successfully uploaded $file"
+              return 0
+            fi
+            
+            echo "  ⚠ Attempt $i failed or timed out. Retrying..."
+            sleep 5
+          done
+          return 1
+        }
+        
+        # Process each cache entry
+        for ((idx=0; idx<${#PATHS_ARRAY[@]}; idx++)); do
+          CACHE_PATH="${PATHS_ARRAY[$idx]}"
+          CACHE_KEY="${KEYS_ARRAY[$idx]}"
+          CACHE_BUCKET="${BUCKETS_ARRAY[$idx]}"
+          
+          [ -z "$CACHE_PATH" ] && continue
+          
+          TAG_NAME="$CACHE_BUCKET"
+          BASE_FILENAME="cache-$CACHE_KEY"
+          
+          if [ "${{ inputs.compression_level }}" -eq 0 ]; then
+            FILENAME="$BASE_FILENAME.tar"
+          else
+            FILENAME="$BASE_FILENAME.tzst"
+          fi
+          
+          echo "::group:: [$((idx+1))/${#PATHS_ARRAY[@]}] Checking Release State ($CACHE_BUCKET)"
+          ensure_release "$TAG_NAME"
+          echo "::endgroup::"
+          
+          echo "::group:: [$((idx+1))/${#PATHS_ARRAY[@]}] Archiving Path: $CACHE_PATH"
+          
+          if [ ! -d "$CACHE_PATH" ] && [ ! -f "$CACHE_PATH" ]; then
+            echo "⚠️ Target path not found. Skipping cache save."
+            echo "::endgroup::"
+            continue
+          fi
+          
+          DIR_NAME=$(dirname "$CACHE_PATH")
+          BASE_NAME=$(basename "$CACHE_PATH")
+          
+          if [ "${{ inputs.compression_level }}" -eq 0 ]; then
+            tar --posix -h -cvf "$FILENAME" -C "$DIR_NAME" "$BASE_NAME" > /dev/null 2>&1
+          else
+            tar --posix -h -I "zstd -T0 -${{ inputs.compression_level }}" -cvf "$FILENAME" -C "$DIR_NAME" "$BASE_NAME" > /dev/null 2>&1
+          fi
+          
+          FILE_SIZE=$(stat -c%s "$FILENAME")
+          echo "Archive created: $FILENAME ($FILE_SIZE bytes)"
+          echo "::endgroup::"
+          
+          echo "::group:: [$((idx+1))/${#PATHS_ARRAY[@]}] Uploading Assets ($CACHE_BUCKET)"
+          MAX_SIZE=2000000000 # ~1.86GB
+          
+          if [ "$FILE_SIZE" -gt "$MAX_SIZE" ]; then
+            echo "⚠ File > 2GB. Splitting..."
+            split -b 1500M -a 2 "$FILENAME" "${FILENAME}.part"
+            for part in "${FILENAME}".part*; do
+              echo "Uploading $part..."
+              if ! upload_with_retry "$part" "$TAG_NAME"; then
+                echo "::error::Failed to upload part $part after multiple attempts."
+                exit 1
+              fi
+              rm -f "$part"
+            done
+            rm -rf "$FILENAME"
+          else
+            echo "Uploading $FILENAME..."
+            if ! upload_with_retry "$FILENAME" "$TAG_NAME"; then
+              echo "::error::Failed to upload $FILENAME after multiple attempts."
+              exit 1
+            fi
+            rm -f "$FILENAME"
+          fi
+          echo "::endgroup::"
+        done

+ 140 - 0
.github/actions/cache-setup/action.yml

@@ -0,0 +1,140 @@
+name: 'Setup Cache'
+description: 'Sets up ccache and Bazel remote cache configuration for the build environment'
+inputs:
+  kernel_version:
+    description: 'Kernel version (e.g., 6.1)'
+    required: true
+  android_version:
+    description: 'Android version (e.g., android14)'
+    required: true
+  sublevel:
+    description: 'Sublevel of kernel version (e.g., 1)'
+    required: true
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Setup ccache
+      shell: bash
+      if: |
+        (inputs.kernel_version == '5.10' && inputs.android_version == 'android12') ||
+        (inputs.kernel_version == '5.15' && inputs.android_version == 'android13') || 
+        (inputs.kernel_version == '5.15' && inputs.android_version == 'android13')
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        # Download and install ccache
+        echo "Installing ccache..."
+        curl -LfsS --retry 5 --retry-delay 5 --retry-all-errors --connect-timeout 30 --tcp-fastopen -H "User-Agent: Mozilla/5.0" "https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/ccache/ccache-x86-64" -o ccache || { echo "❌ Failed to download ccache"; exit 1; }
+        sudo cp -f ./ccache /usr/bin/ccache || { echo "❌ Failed to install ccache"; exit 1; }
+        sudo chmod +x /usr/bin/ccache
+        rm -f ./ccache
+        
+        # Verify ccache
+        if ! /usr/bin/ccache --version > /dev/null 2>&1; then
+          echo "❌ ccache installation failed or binary is corrupted"
+          exit 1
+        fi
+        echo "✅ ccache binary verified: $(/usr/bin/ccache --version | head -1)"
+        
+        # Setup cache directories
+        export CCACHE_DIR="/home/runner/.ccache"
+        echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
+        mkdir -p "$CCACHE_DIR"
+        
+        echo "CC=/usr/bin/ccache clang" >> "$GITHUB_ENV"
+        echo "CXX=/usr/bin/ccache clang++" >> "$GITHUB_ENV"
+        echo "HOSTCC=/usr/bin/ccache clang" >> "$GITHUB_ENV"
+        echo "HOSTCXX=/usr/bin/ccache clang++" >> "$GITHUB_ENV"
+
+        export CCACHE_MAXSIZE="12G"
+        echo CCACHE_MAXSIZE="$CCACHE_MAXSIZE" >> $GITHUB_ENV
+        export CCACHE_COMPILERCHECK="%compiler% -dumpmachine; %compiler% -dumpversion"
+        echo CCACHE_COMPILERCHECK="$CCACHE_COMPILERCHECK" >> $GITHUB_ENV
+        export CCACHE_BASEDIR="${GITHUB_WORKSPACE}"
+        echo CCACHE_BASEDIR="${GITHUB_WORKSPACE}" >> $GITHUB_ENV
+        export CCACHE_NOHASHDIR="true"
+        echo CCACHE_NOHASHDIR="true" >> $GITHUB_ENV
+        export CCACHE_IGNOREOPTIONS="--sysroot*"
+        echo CCACHE_IGNOREOPTIONS="--sysroot*" >> $GITHUB_ENV
+        export CCACHE_COMPRESSION="true"
+        echo CCACHE_COMPRESSION="true" >> $GITHUB_ENV
+        export CCACHE_COMPRESSLEVEL="9"
+        echo CCACHE_COMPRESSION_LEVEL="9" >> $GITHUB_ENV
+        # Temporarily disabled for cache hit testing
+        # export CCACHE_DIRECT="true"
+        # echo CCACHE_DIRECT="true" >> "$GITHUB_ENV"
+        # Temporarily disabled for cache hit testing
+        # export CCACHE_FILE_CLONE="true"
+        # echo CCACHE_FILE_CLONE="true" >> "$GITHUB_ENV"
+        # Temporarily disabled for cache hit testing
+        # export CCACHE_INODE_CACHE="true"
+        # echo CCACHE_INODE_CACHE="true" >> "$GITHUB_ENV"
+        export CCACHE_IS_KERNEL_COMPILING="true"
+        echo CCACHE_IS_KERNEL_COMPILING="true" >> $GITHUB_ENV
+        export CCACHE_UMASK="002"
+        echo CCACHE_UMASK="002" >> $GITHUB_ENV
+        export CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale"
+        echo CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale" >> $GITHUB_ENV
+        #export CCACHE_HARDLINK="true"
+        #echo CCACHE_HARDLINK="$CCACHE_HARDLINK" >> $GITHUB_ENV
+
+        if ccache --help 2>&1 | grep -q 'depend_mode'; then
+          export CCACHE_DEPEND=true
+          echo "CCACHE_DEPEND=true" >> "$GITHUB_ENV"
+        fi
+          
+        echo "===================="
+        echo "=== ccache stats ==="
+        echo "===================="
+        ccache -s
+        echo "====================="
+        echo "=== ccache config ==="
+        echo "====================="
+        ccache -p
+        echo "====================="
+        ccache -z
+
+        echo "✅ ccache ready"
+        echo "CCACHE_DIR: $CCACHE_DIR"
+
+    - name: Setup Bazel Cache
+      shell: bash
+      if: |
+        (inputs.kernel_version == '5.15' && inputs.android_version == 'android14') ||
+        (inputs.kernel_version == '6.1' && inputs.android_version == 'android14') ||
+        (inputs.kernel_version == '6.6' && inputs.android_version == 'android15') ||
+        (inputs.kernel_version == '6.12' && inputs.android_version == 'android16')
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        export BAZEL_CACHE_DIR="/home/runner/.cache/bazel"
+        echo "BAZEL_CACHE_DIR=$BAZEL_CACHE_DIR" >> $GITHUB_ENV
+        mkdir -p "$BAZEL_CACHE_DIR"
+
+        echo "✅ Bazel Cache ready"
+        echo "BAZEL_CACHE_DIR: $BAZEL_CACHE_DIR"
+
+    - name: Setup ld cache
+      shell: bash
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        export LDCACHE_DIR="/home/runner/.ld_cache"
+        echo "LDCACHE_DIR=$LDCACHE_DIR" >> $GITHUB_ENV
+        mkdir -p "$LDCACHE_DIR"
+          
+        # Create LD wrapper for thin-LTO caching
+        cat > "$GITHUB_WORKSPACE/kernel/common/ld-wrapper" << 'EOF'
+        #!/bin/bash
+        ld.lld "$@" --thinlto-cache-dir="$LDCACHE_DIR" --thinlto-jobs="$(nproc --all)"
+        EOF
+        chmod +x "$GITHUB_WORKSPACE/kernel/common/ld-wrapper"
+
+        # Setup cache directories
+        echo "LD=$GITHUB_WORKSPACE/kernel/common/ld-wrapper" >> "$GITHUB_ENV"
+        echo "HOSTLD=$GITHUB_WORKSPACE/kernel/common/ld-wrapper" >> "$GITHUB_ENV"
+
+        echo "✅ LD Cache ready"
+        echo "LDCACHE_DIR: $LDCACHE_DIR"
+        

+ 57 - 0
.github/actions/cache-stats/action.yml

@@ -0,0 +1,57 @@
+name: 'Show Cache Stats'
+description: 'Displays statistics for ccache and Bazel remote cache to help analyze cache performance and hit rates'
+
+runs:
+  using: 'composite'
+  steps:
+    - name: Show ccache Stats
+      shell: bash
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        echo "===================="
+        echo "=== ccache stats ==="
+        echo "===================="
+        ccache -s || true
+        echo "====================="
+        echo "=== ccache config ==="
+        echo "====================="
+        ccache -p || true
+        echo "====================="
+
+    - name: Show ccache folder Stats
+      shell: bash
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        echo "==============="
+        echo "=== .ccache ==="
+        echo "==============="
+        du -sh /home/runner/.ccache || true
+        ls -l /home/runner/.ccache || true
+        echo "==============="
+
+    - name: Show Bazel Cache folder Stats
+      shell: bash
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        echo "===================="
+        echo "=== .cache/bazel ==="
+        echo "===================="
+        du -sh /home/runner/.cache/bazel || true
+        ls -l /home/runner/.cache/bazel || true
+        echo "===================="
+        
+    - name: Show ld cache folder Stats
+      shell: bash
+      working-directory: ${{ github.workspace }}
+      run: |
+        set -euo pipefail
+        echo "================="
+        echo "=== .ld_cache ==="
+        echo "================="
+        du -sh /home/runner/.ld_cache || true
+        ls -l /home/runner/.ld_cache || true
+        echo "================="
+        

+ 0 - 127
.github/actions/save-cache/action.yml

@@ -1,127 +0,0 @@
-name: 'Save Cache'
-description: 'Archives and uploads cache to GitHub Releases with intelligent splitting and retry logic'
-
-inputs:
-  cache_path:
-    description: 'Path where cache is saved'
-    required: true
-    type: string
-  cache_key:
-    description: 'Unique key for the cache'
-    required: true
-    type: string
-  cache_bucket:
-    description: 'The tag name for the release (e.g., general-cache)'
-    required: true
-    default: 'general-cache'
-  compression_level:
-    description: 'Compression level (0-9). 0 = No compression, 1 = Fast, 19 = Best.'
-    required: false
-    type: number
-    default: 6
-  github_token:
-    description: 'GitHub token for release upload authentication'
-    required: true
-    type: string
-
-runs:
-  using: 'composite'
-  steps:
-    - name: Archive, Split, and Upload Cache
-      shell: bash
-      env:
-        GITHUB_TOKEN: ${{ inputs.github_token }}
-        TARGET_REPO: "${{ github.repository }}"
-      run: |
-        # Archive, Split, and Upload Cache
-        git config user.name "github-actions[bot]"
-        git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
-        
-        TAG_NAME="${{ inputs.cache_bucket }}"
-        BASE_FILENAME="cache-${{ inputs.cache_key }}"
-        
-        if [ "${{ inputs.compression_level }}" -eq 0 ]; then
-          FILENAME="$BASE_FILENAME.tar"
-        else
-          FILENAME="$BASE_FILENAME.tzst"
-        fi
-        
-        echo "::group:: Checking Release State"
-        
-        git fetch --tags --force
-        
-        if ! git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
-          echo "Tag '$TAG_NAME' not found. Creating backdated release..."
-          GIT_COMMITTER_DATE="2015-01-01T12:00:00" git tag -a "$TAG_NAME" -m "General Cache Storage"
-          if git push origin "$TAG_NAME" --force; then
-            gh release create "$TAG_NAME" --title "General Cache" --notes "Automated storage for build assets" --repo "$TARGET_REPO" || true
-          else
-            echo "Push failed, tag might have been created by a parallel job. Continuing..."
-          fi
-        else
-          echo "Release '$TAG_NAME' already exists. Ready for upload."
-        fi
-        echo "::endgroup::"
-        
-        echo "::group:: Archiving Path"
-        echo "Target: ${{ inputs.cache_path }}"
-        
-        if [ ! -d "${{ inputs.cache_path }}" ] && [ ! -f "${{ inputs.cache_path }}" ]; then
-          echo "⚠️ Target path not found. Skipping cache save."
-          echo "::endgroup::"
-        else
-          DIR_NAME=$(dirname "${{ inputs.cache_path }}")
-          BASE_NAME=$(basename "${{ inputs.cache_path }}")
-          
-          if [ "${{ inputs.compression_level }}" -eq 0 ]; then
-            tar --posix -h -cvf "$FILENAME" -C "$DIR_NAME" "$BASE_NAME" > /dev/null 2>&1
-          else
-            tar --posix -h -I "zstd -T0 -${{ inputs.compression_level }}" -cvf "$FILENAME" -C "$DIR_NAME" "$BASE_NAME" > /dev/null 2>&1
-          fi
-          
-          FILE_SIZE=$(stat -c%s "$FILENAME")
-          echo "Archive created: $FILENAME ($FILE_SIZE bytes)"
-          echo "::endgroup::"
-          
-          echo "::group:: Uploading Assets"
-          MAX_SIZE=2000000000 # ~1.86GB
-          
-          upload_with_retry() {
-            local file=$1
-            local max_attempts=3
-            for ((i=1; i<=max_attempts; i++)); do
-              echo "  Attempt $i for $file..."
-              
-              if timeout 10m gh release upload "$TAG_NAME" "$file" --clobber --repo "$TARGET_REPO" > /dev/null 2>&1; then
-                echo "  Successfully uploaded $file"
-                return 0
-              fi
-              
-              echo "  ⚠ Attempt $i failed or timed out. Retrying..."
-              sleep 5
-            done
-            return 1
-          }
-          
-          if [ "$FILE_SIZE" -gt "$MAX_SIZE" ]; then
-            echo "⚠ File > 2GB. Splitting..."
-            split -b 1500M -a 2 "$FILENAME" "${FILENAME}.part"
-            for part in "${FILENAME}".part*; do
-              echo "Uploading $part..."
-              if ! upload_with_retry "$part"; then
-                echo "::error::Failed to upload part $part after multiple attempts."
-                exit 1
-              fi
-              rm -f "$part"
-            done
-            rm -rf "$FILENAME"
-          else
-            echo "Uploading $FILENAME..."
-            if ! upload_with_retry "$FILENAME"; then
-              echo "::error::Failed to upload $FILENAME after multiple attempts."
-              exit 1
-            fi
-            rm -f "$FILENAME"
-          fi
-          echo "::endgroup::"
-        fi

+ 49 - 254
.github/workflows/build.yml

@@ -26,12 +26,6 @@ jobs:
     timeout-minutes: 60
 
     steps:
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
-
     - name: Checkout Repository
       uses: actions/checkout@v5
 
@@ -42,7 +36,7 @@ jobs:
         kernel_version: ${{ inputs.kernel_version }}
 
     - name: Free Disk Space
-      if: true
+      if: false
       uses: endersonmenezes/free-disk-space@v3  # Use @main for latest, @v3 for stable
       with:
         remove_android: true
@@ -56,34 +50,16 @@ jobs:
         rmz_version: "3.1.1"  # Required when rm_cmd is 'rmz'
         testing: false
 
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
-
     - name: Setup more Swap (for LTO)
       uses: thejerrybao/setup-swap-space@v1   # or pierotofy/set-swap-space
       with:
         swap-size-gb: 10          # 10-24 GB is common for heavy LTO
         # swap-space-path: /mnt/swapfile   # optional
 
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
-
     - name: Setup Build Environment
       uses: ./.github/actions/setup-build-environment
       env:
         BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }}
-
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
           
     - name: Download Kernel Repository
       uses: ./.github/actions/download-kernel
@@ -93,12 +69,6 @@ jobs:
         os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
         use_repo: ${{ inputs.use_repo }}
 
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
-
     - name: Extract Sublevel and Set File Name
       id: extract
       uses: ./.github/actions/extract-sublevel-file-name
@@ -208,195 +178,48 @@ jobs:
         if-no-files-found: ignore
         compression-level: 9
 
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
-
-    - name: 'Setup ccache and Build Environment'
-      shell: bash
-      if: true
-      working-directory: ${{ github.workspace }}/kernel
-      run: |
-        set -euo pipefail
-        if [ -f "build/build.sh" ]; then
-          # Download and install ccache
-          echo "Installing ccache..."
-          curl -LfsS --retry 5 --retry-delay 5 --retry-all-errors --connect-timeout 30 --tcp-fastopen -H "User-Agent: Mozilla/5.0" "https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/ccache/ccache-x86-64" -o ccache || { echo "❌ Failed to download ccache"; exit 1; }
-          sudo cp -f ./ccache /usr/bin/ccache || { echo "❌ Failed to install ccache"; exit 1; }
-          sudo chmod +x /usr/bin/ccache
-          rm -f ./ccache
-          
-          # Verify ccache
-          if ! /usr/bin/ccache --version > /dev/null 2>&1; then
-            echo "❌ ccache installation failed or binary is corrupted"
-            exit 1
-          fi
-          echo "✅ ccache binary verified: $(/usr/bin/ccache --version | head -1)"
-          
-          # Setup cache directories
-          export CCACHE_DIR="/home/runner/.ccache"
-          echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
-          export LDCACHE_DIR="/home/runner/.ld_cache"
-          echo "LDCACHE_DIR=$LDCACHE_DIR" >> $GITHUB_ENV
-          mkdir -p "$CCACHE_DIR" "$LDCACHE_DIR"
-          
-          # Create LD wrapper for thin-LTO caching
-          cat > "$GITHUB_WORKSPACE/kernel/common/ld-wrapper" << 'EOF'
-          #!/bin/bash
-          ld.lld "$@" --thinlto-cache-dir="$LDCACHE_DIR" --thinlto-jobs="$(nproc --all)"
-          EOF
-          chmod +x "$GITHUB_WORKSPACE/kernel/common/ld-wrapper"
-          
-          echo "CC=/usr/bin/ccache clang" >> "$GITHUB_ENV"
-          echo "CXX=/usr/bin/ccache clang++" >> "$GITHUB_ENV"
-          echo "HOSTCC=/usr/bin/ccache clang" >> "$GITHUB_ENV"
-          echo "HOSTCXX=/usr/bin/ccache clang++" >> "$GITHUB_ENV"
-          echo "LD=$GITHUB_WORKSPACE/kernel/common/ld-wrapper" >> "$GITHUB_ENV"
-          echo "HOSTLD=$GITHUB_WORKSPACE/kernel/common/ld-wrapper" >> "$GITHUB_ENV"
-
-          export CCACHE_MAXSIZE="12G"
-          echo CCACHE_MAXSIZE="$CCACHE_MAXSIZE" >> $GITHUB_ENV
-          export CCACHE_COMPILERCHECK="%compiler% -dumpmachine; %compiler% -dumpversion"
-          echo CCACHE_COMPILERCHECK="$CCACHE_COMPILERCHECK" >> $GITHUB_ENV
-          export CCACHE_BASEDIR="${GITHUB_WORKSPACE}"
-          echo CCACHE_BASEDIR="${GITHUB_WORKSPACE}" >> $GITHUB_ENV
-          export CCACHE_NOHASHDIR="true"
-          echo CCACHE_NOHASHDIR="true" >> $GITHUB_ENV
-          export CCACHE_IGNOREOPTIONS="--sysroot*"
-          echo CCACHE_IGNOREOPTIONS="--sysroot*" >> $GITHUB_ENV
-          export CCACHE_COMPRESSION="true"
-          echo CCACHE_COMPRESSION="true" >> $GITHUB_ENV
-          export CCACHE_COMPRESSLEVEL="9"
-          echo CCACHE_COMPRESSION_LEVEL="9" >> $GITHUB_ENV
-          # Temporarily disabled for cache hit testing
-          # export CCACHE_DIRECT="true"
-          # echo CCACHE_DIRECT="true" >> "$GITHUB_ENV"
-          # Temporarily disabled for cache hit testing
-          # export CCACHE_FILE_CLONE="true"
-          # echo CCACHE_FILE_CLONE="true" >> "$GITHUB_ENV"
-          # Temporarily disabled for cache hit testing
-          # export CCACHE_INODE_CACHE="true"
-          # echo CCACHE_INODE_CACHE="true" >> "$GITHUB_ENV"
-          export CCACHE_IS_KERNEL_COMPILING="true"
-          echo CCACHE_IS_KERNEL_COMPILING="true" >> $GITHUB_ENV
-          export CCACHE_UMASK="002"
-          echo CCACHE_UMASK="002" >> $GITHUB_ENV
-          export CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale"
-          echo CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale" >> $GITHUB_ENV
-          #export CCACHE_HARDLINK="true"
-          #echo CCACHE_HARDLINK="$CCACHE_HARDLINK" >> $GITHUB_ENV
-
-          if ccache --help 2>&1 | grep -q 'depend_mode'; then
-            export CCACHE_DEPEND=true
-            echo "CCACHE_DEPEND=true" >> "$GITHUB_ENV"
-          fi
-          
-          # Initialize ccache
-          #ccache -M 100G
-          ccache -p
-          ccache -s
-          ccache -z
-          
-          echo "✅ Build environment ready"
-          echo "   CCACHE_DIR: $CCACHE_DIR"
-          echo "   LDCACHE_DIR: $LDCACHE_DIR"
-        else
-          export BAZEL_DISK_CACHE_DIR="/home/runner/.bazel_disk_cache"
-          echo "BAZEL_DISK_CACHE_DIR=$BAZEL_DISK_CACHE_DIR" >> $GITHUB_ENV
-          mkdir -p "$BAZEL_DISK_CACHE_DIR"
-
-          echo "✅ Build environment ready"
-          echo "BAZEL_DISK_CACHE_DIR: $BAZEL_DISK_CACHE_DIR"
-        fi
-
-    - name: Restore build caches (ccache)
-      id: restore-ccache
-      uses: ./.github/actions/restore-cache
-      with:
-        cache_path: /home/runner/.ccache
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "ccache-cache"
-        compression_level: 9
-        restore_keys: |
-          buildcache-
-    
-    - name: Restore build caches (bazel)
-      id: restore-bazel-cache
-      uses: ./.github/actions/restore-cache
+    - name: 'Setup Cache and Build Environment'
+      uses: ./.github/actions/cache-setup
       with:
-        cache_path: /home/runner/.cache/bazel
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "bazel-cache"
-        compression_level: 9
-        restore_keys: |
-          buildcache-
-
-    - name: Restore build caches (bazel disk cache)
-      id: restore-bazel-disk-cache
-      uses: ./.github/actions/restore-cache
-      with:
-        cache_path: /home/runner/.bazel_disk_cache
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "bazel-disk-cache"
-        compression_level: 9
-        restore_keys: |
-          buildcache-
+        android_version: ${{ steps.parse.outputs.android_version }}
+        kernel_version: ${{ steps.parse.outputs.kernel_version }}
+        os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
+        sublevel: ${{ steps.extract.outputs.sublevel }}
 
-    - name: Restore build caches (LTO/ld_cache)
-      id: restore-ldcache
-      uses: ./.github/actions/restore-cache
+    - name: Restore build caches (ccache, bazel, bazel-disk, lto)
+      id: restore-caches
+      uses: ./.github/actions/cache-restore
       with:
-        cache_path: /home/runner/.ld_cache
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "lto-cache"
+        cache_paths: |
+          /home/runner/.ccache
+          /home/runner/.cache/bazel
+          /home/runner/.ld_cache
+        cache_keys: |
+          buildcache-${{ inputs.kernel_version }}
+          buildcache-${{ inputs.kernel_version }}
+          buildcache-${{ inputs.kernel_version }}
+          buildcache-${{ inputs.kernel_version }}
+        cache_buckets: |
+          ccache-cache
+          bazel-cache
+          bazel-disk-cache
+          lto-cache
         compression_level: 9
         restore_keys: |
           buildcache-
 
     - name: Check cache hit
       run: |
-        if [ "${{ steps.restore-ccache.outputs.cache-hit }}" = "true" ]; then
-          echo "✅ ccache HIT - Key: ${{ steps.restore-ccache.outputs.cache-key }} - Size: ${{ steps.restore-ccache.outputs.cache-size }}"
-        else
-          echo "❌ ccache MISS - Fresh build"
-        fi
-        if [ "${{ steps.restore-bazel-cache.outputs.cache-hit }}" = "true" ]; then
-          echo "✅ bazel cache HIT - Key: ${{ steps.restore-bazel-cache.outputs.cache-key }} - Size: ${{ steps.restore-bazel-cache.outputs.cache-size }}"
+        if [ "${{ steps.restore-caches.outputs.cache-hit }}" = "true" ]; then
+          echo "✅ Cache HIT"
+          echo "   Keys: ${{ steps.restore-caches.outputs.cache-key }}"
+          echo "   Sizes: ${{ steps.restore-caches.outputs.cache-size }}"
         else
-          echo "❌ bazel cache MISS - Fresh build"
+          echo "❌ No caches found - Fresh build"
         fi
-        if [ "${{ steps.restore-ldcache.outputs.cache-hit }}" = "true" ]; then
-          echo "✅ ld_cache HIT - Key: ${{ steps.restore-ldcache.outputs.cache-key }} - Size: ${{ steps.restore-ldcache.outputs.cache-size }}"
-        else
-          echo "❌ ld_cache MISS - Fresh build"
-        fi
-        ccache -p
-        ccache -s
-        ccache -z
 
-    - name: List cache contents
-      working-directory: ${{ github.workspace }}
-      run: |
-        echo "=== .ccache ==="
-        du -sh /home/runner/.ccache || true
-        ls -l /home/runner/.ccache || true
-        echo "=== .cache/bazel ==="
-        du -sh /home/runner/.cache/bazel || true
-        ls -l /home/runner/.cache/bazel || true
-        echo "=== .ld_cache ==="
-        du -sh /home/runner/.ld_cache || true
-        ls -l /home/runner/.ld_cache || true
-        echo "=== .bazel_disk_cache ==="
-        du -sh /home/runner/.bazel_disk_cache || true
-        ls -l /home/runner/.bazel_disk_cache || true
-
-    - name: Display system disk usage
-      run: |
-        echo "=== Disk usage summary ==="
-        df -h
-        echo ""
+    - name: List cache stats
+      uses: ./.github/actions/cache-stats
 
     - name: Build Kernel
       env:
@@ -443,54 +266,26 @@ jobs:
         echo "direct_rate=${DIRECT_RATE}%"
 
     - name: List cache contents
-      working-directory: ${{ github.workspace }}
-      run: |
-        echo "=== .ccache ==="
-        du -sh /home/runner/.ccache || true
-        ls -l /home/runner/.ccache || true
-        echo "=== .cache/bazel ==="
-        du -sh /home/runner/.cache/bazel || true
-        ls -l /home/runner/.cache/bazel || true
-        echo "=== .ld_cache ==="
-        du -sh /home/runner/.ld_cache || true
-        ls -l /home/runner/.ld_cache || true
-        echo "=== .bazel_disk_cache ==="
-        du -sh /home/runner/.bazel_disk_cache || true
-        ls -l /home/runner/.bazel_disk_cache || true
-
-    - name: Save ccache cache
-      uses: ./.github/actions/save-cache
-      with:
-        cache_path: /home/runner/.ccache
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "ccache-cache"
-        compression_level: 9
-        github_token: ${{ secrets.GITHUB_TOKEN }}
-
-    - name: Save bazel cache
-      uses: ./.github/actions/save-cache
-      with:
-        cache_path: /home/runner/.cache/bazel
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "bazel-cache"
-        compression_level: 9
-        github_token: ${{ secrets.GITHUB_TOKEN }}
-
-    - name: Save bazel disk cache
-      uses: ./.github/actions/save-cache
-      with:
-        cache_path: /home/runner/.bazel_disk_cache
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "bazel-disk-cache"
-        compression_level: 9
-        github_token: ${{ secrets.GITHUB_TOKEN }}
+      uses: ./.github/actions/cache-stats
 
-    - name: Save LTO LD cache
-      uses: ./.github/actions/save-cache
+    - name: Save build caches (ccache, bazel, bazel-disk, lto)
+      uses: ./.github/actions/cache-save
       with:
-        cache_path: /home/runner/.ld_cache
-        cache_key: buildcache-${{ inputs.kernel_version }}
-        cache_bucket: "lto-cache"
+        cache_paths: |
+          /home/runner/.ccache
+          /home/runner/.cache/bazel
+
+          /home/runner/.ld_cache
+        cache_keys: |
+          buildcache-${{ inputs.kernel_version }}
+          buildcache-${{ inputs.kernel_version }}
+          buildcache-${{ inputs.kernel_version }}
+          buildcache-${{ inputs.kernel_version }}
+        cache_buckets: |
+          ccache-cache
+          bazel-cache
+          bazel-disk-cache
+          lto-cache
         compression_level: 9
         github_token: ${{ secrets.GITHUB_TOKEN }}
 

+ 1 - 2
.gitignore

@@ -1,3 +1,2 @@
 AIO-REJ/
-manifests/
-job-logs.txt
+kernel-manifests/