| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- name: 'Setup ccache'
- description: 'Install and configure ccache for older kernels (android12/13)'
- inputs:
- version:
- description: 'Kernel config version (e.g., android14-6.1)'
- required: true
- runs:
- using: 'composite'
- steps:
- - name: Setup ccache
- shell: bash
- if: |
- inputs.version == 'android12-5.10' ||
- inputs.version == 'android13-5.10' ||
- inputs.version == 'android13-5.15'
- working-directory: ${{ github.workspace }}
- run: |
- set -euo pipefail
- echo "Installing ccache..."
- if [ -s "${{ github.workspace }}/ccache-dl/ccache" ]; then
- sudo cp -f "${{ github.workspace }}/ccache-dl/ccache" /usr/bin/ccache
- sudo chmod +x /usr/bin/ccache
- rm -rf "${{ github.workspace }}/ccache-dl"
- echo "✅ installed from shared artifact"
- else
- curl -LfsS --retry 5 --retry-delay 5 --retry-all-errors --connect-timeout 30 \
- -H "User-Agent: Mozilla/5.0" \
- "https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/ccache/ccache-x86-64" -o ccache
- sudo cp -f ./ccache /usr/bin/ccache
- sudo chmod +x /usr/bin/ccache
- rm -f ./ccache
- echo "✅ installed from download"
- fi
- if ! /usr/bin/ccache --version > /dev/null 2>&1; then
- echo "❌ ccache installation failed"
- exit 1
- fi
- echo "✅ ccache verified: $(/usr/bin/ccache --version | head -1)"
- export CCACHE_DIR="/home/runner/.ccache"
- echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
- mkdir -p "$CCACHE_DIR"
- export CCACHE_MAXSIZE="12G"
- echo CCACHE_MAXSIZE="$CCACHE_MAXSIZE" >> $GITHUB_ENV
- export CCACHE_COMPILERCHECK="content"
- 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="3"
- echo CCACHE_COMPRESSION_LEVEL="3" >> $GITHUB_ENV
- export CCACHE_DIRECT="true"
- echo CCACHE_DIRECT="true" >> "$GITHUB_ENV"
- export CCACHE_FILE_CLONE="true"
- echo CCACHE_FILE_CLONE="true" >> "$GITHUB_ENV"
- 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
- if ccache --help 2>&1 | grep -q 'depend_mode'; then
- export CCACHE_DEPEND=true
- echo "CCACHE_DEPEND=true" >> "$GITHUB_ENV"
- fi
- echo "=== ccache config ==="
- ccache -p
- echo "====================="
- echo "✅ ccache ready"
|