7878
7979jobs :
8080 build :
81- runs-on : ubuntu-latest
81+ runs-on : ubuntu-24.04
8282
8383 steps :
8484 - name : Checkout Repository
@@ -89,12 +89,31 @@ jobs:
8989 with :
9090 swap-size-gb : ${{ inputs.swap_size || '16' }}
9191
92+ - name : Configure CCache
93+ run : |
94+ echo "CCACHE_DIR=$HOME/.ccache_${{ inputs.device_name }}" >> $GITHUB_ENV
95+
9296 - name : Restore CCache
9397 uses : actions/cache/restore@v4
9498 with :
95- path : ~/.ccache
96- key : ccache-${{ inputs.device_name }}-${{ github.run_id }}
97- restore-keys : ccache-${{ inputs.device_name }}-
99+ path : $HOME/.ccache_${{ inputs.device_name }}
100+ key : ccache-${{ inputs.device_name }}-${{ inputs.lto_type }}-${{ github.run_id }}
101+ restore-keys : |
102+ ccache-${{ inputs.device_name }}-${{ inputs.lto_type }}-
103+ ccache-${{ inputs.device_name }}-
104+
105+ - name : Init CCache
106+ run : |
107+ export CCACHE_DIR="$HOME/.ccache_${{ inputs.device_name }}"
108+ export CCACHE_COMPILERCHECK="none"
109+ export CCACHE_BASEDIR="${{ github.workspace }}"
110+ export CCACHE_NOHASHDIR="true"
111+ export CCACHE_HARDLINK="true"
112+ mkdir -p "$CCACHE_DIR"
113+ ccache -M 10G
114+ ccache -o compression=true
115+ echo "sloppiness = file_stat_matches,include_file_ctime,include_file_mtime,pch_defines,file_macro,time_macros" >> "$CCACHE_DIR/ccache.conf"
116+ ccache -s
98117
99118 - name : Install Dependencies
100119 run : |
@@ -221,6 +240,9 @@ jobs:
221240 echo "CONFIG_KSU_SUSFS_SPOOF_CMDLINE_OR_BOOTCONFIG=y" >> "$DEFCONFIG"
222241 echo "CONFIG_KSU_SUSFS_OPEN_REDIRECT=y" >> "$DEFCONFIG"
223242 echo "CONFIG_KSU_SUSFS_SUS_MAP=y" >> "$DEFCONFIG"
243+
244+ # Optimization
245+ echo "CONFIG_HZ_300=y" >> "$DEFCONFIG"
224246
225247 # Enable Huawei LZ4KO Crypto Algorithm
226248 if [ "${{ github.event.inputs.huawei_lz4ko }}" == "true" ]; then
@@ -352,12 +374,16 @@ jobs:
352374 run : |
353375 git config --global user.email "bot@example.com"
354376 git config --global user.name "wannq"
355- export CCACHE_DIR=~/.ccache
356- ccache -M 5G
377+ export CCACHE_DIR="$HOME/.ccache_${{ inputs.device_name }}"
378+ export CCACHE_COMPILERCHECK="none"
379+ export CCACHE_BASEDIR="${{ github.workspace }}"
380+ export CCACHE_NOHASHDIR="true"
381+ export CCACHE_HARDLINK="true"
382+ export PATH="/usr/lib/ccache:$PATH"
357383 export LOCALVERSION="${{ inputs.localversion }}"
358384 chmod +x ./build.sh
359385 # Tell the script to use ccache
360- ./build.sh all ${{ inputs.device_name }} CC="ccache clang" 2>&1 | tee /tmp/kbuild.log
386+ ./build.sh all ${{ inputs.device_name }} 2>&1 | tee /tmp/kbuild.log
361387
362388 # Look for the Image in the 'out' directory or '../out' directory
363389 if [ ! -f out/arch/arm64/boot/Image ] && [ ! -f ../out/arch/arm64/boot/Image ]; then
@@ -370,8 +396,8 @@ jobs:
370396 if : always()
371397 uses : actions/cache/save@v4
372398 with :
373- path : ~/.ccache
374- key : ccache-${{ inputs.device_name }}-${{ github.run_id }}
399+ path : ${{ env.CCACHE_DIR }}
400+ key : ccache-${{ inputs.device_name }}-${{ inputs.lto_type }}-${{ github.run_id }}
375401
376402 - name : Compress & Upload
377403 run : |
0 commit comments