Ver Fonte

feat(action): enhance ccache configuration by moving settings to build script and increasing max size

Co-authored-by: Copilot <copilot@github.com>
TheWildJames há 4 meses atrás
pai
commit
61b9e37b50
2 ficheiros alterados com 17 adições e 38 exclusões
  1. 17 1
      .github/actions/build-kernel/action.yml
  2. 0 37
      .github/workflows/build.yml

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

@@ -10,9 +10,25 @@ runs:
         set -euo pipefail
         export CCACHE_DIR="$GITHUB_WORKSPACE/.ccache"
         export PATH="/usr/lib/ccache:$PATH"
-        # For build.sh, force CC/CXX to use ccache
         export CC="ccache gcc"
         export CXX="ccache g++"
+        export CCACHE_MAXSIZE=1G
+        export CCACHE_COMPILERCHECK=content
+        export CCACHE_BASEDIR="$GITHUB_WORKSPACE"
+        export CCACHE_NOHASHDIR=true
+        export CCACHE_IGNOREOPTIONS=--sysroot*
+        export CCACHE_COMPRESSION=true
+        export CCACHE_COMPRESSION_LEVEL=3
+        export CCACHE_DIRECT=true
+        export CCACHE_FILE_CLONE=true
+        export CCACHE_INODE_CACHE=true
+        export CCACHE_UMASK=002
+        export CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale"
+        if ccache --help 2>&1 | grep -q 'depend_mode'; then
+          export CCACHE_DEPEND=true
+        fi
+        echo "✅ ccache environment variables set"
+        ccache -p
         if [ -f "build/build.sh" ]; then
           SKIP_MRPROPER=1 SKIP_EXT_MODULES=1 SKIP_CP_KERNEL_HDR=1 GKI_DEFCONFIG_FRAGMENT="$GITHUB_WORKSPACE/wild_gki.fragment" BUILD_CONFIG=common/build.config.gki.aarch64 CC="$CC" CXX="$CXX" build/build.sh
         else

+ 0 - 37
.github/workflows/build.yml

@@ -210,43 +210,6 @@ jobs:
         restore-keys: |
           buildcache-
 
-    - name: ♻️ Configure ccache (bounded)
-      run: |
-        echo "::group::Configure ccache environment"
-        set -euo pipefail
-        if command -v ccache >/dev/null 2>&1; then
-          CACHE_DIR="${{ github.workspace }}/.ccache"
-          mkdir -p "$CACHE_DIR"
-          SETTINGS=(
-            "CCACHE_DIR=$CACHE_DIR"
-            "CCACHE_MAXSIZE=1G"
-            "CCACHE_COMPILERCHECK=content"
-            "CCACHE_BASEDIR=${GITHUB_WORKSPACE}"
-            "CCACHE_NOHASHDIR=true"
-            "CCACHE_IGNOREOPTIONS=--sysroot*"
-            "CCACHE_COMPRESSION=true"
-            "CCACHE_COMPRESSION_LEVEL=3"
-            "CCACHE_DIRECT=true"
-            "CCACHE_FILE_CLONE=true"
-            "CCACHE_INODE_CACHE=true"
-            "CCACHE_UMASK=002"
-            "CCACHE_SLOPPINESS=file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale"
-          )
-          for setting in "${SETTINGS[@]}"; do
-            export "$setting"
-            echo "$setting" >> "$GITHUB_ENV"
-          done
-          if ccache --help 2>&1 | grep -q 'depend_mode'; then
-            export CCACHE_DEPEND=true
-            echo "CCACHE_DEPEND=true" >> "$GITHUB_ENV"
-          fi
-          echo "✅ ccache configured successfully"
-          echo "Current ccache configuration:"
-          ccache -p
-        else
-          echo "ccache not found, skipping configuration."
-        fi
-        echo "::endgroup::"
 
     - name: Build Kernel
       env: