build.yml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. name: Kernel Build Process
  2. permissions:
  3. contents: write
  4. actions: write
  5. on:
  6. workflow_call:
  7. inputs:
  8. kernel_version:
  9. required: true
  10. type: string
  11. variant:
  12. required: false
  13. type: string
  14. feature_set:
  15. required: true
  16. type: string
  17. use_repo:
  18. required: false
  19. type: boolean
  20. jobs:
  21. build-gki:
  22. name: "${{ inputs.kernel_version }} (${{ inputs.variant }})"
  23. runs-on: ubuntu-latest
  24. timeout-minutes: 60
  25. steps:
  26. - name: Checkout Repository
  27. uses: actions/checkout@v5
  28. - name: Parse kernel version
  29. id: parse
  30. uses: ./.github/actions/parse-kernel-version
  31. with:
  32. kernel_version: ${{ inputs.kernel_version }}
  33. - name: Free Disk Space
  34. if: true
  35. uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
  36. with:
  37. remove_android: true
  38. remove_dotnet: true
  39. remove_haskell: true
  40. remove_tool_cache: true
  41. remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
  42. remove_packages_one_command: true
  43. remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
  44. rm_cmd: "rmz" # Use 'rmz' for faster deletion (default: 'rm')
  45. rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
  46. testing: false
  47. - name: Setup more Swap (for LTO)
  48. uses: thejerrybao/setup-swap-space@v1 # or pierotofy/set-swap-space
  49. with:
  50. swap-size-gb: 10 # 10-24 GB is common for heavy LTO
  51. # swap-space-path: /mnt/swapfile # optional
  52. - name: Setup Build Environment
  53. uses: ./.github/actions/setup-build-environment
  54. env:
  55. BOOT_SIGN_KEY: ${{ secrets.BOOT_SIGN_KEY }}
  56. - name: Download Kernel Repository
  57. uses: ./.github/actions/download-kernel
  58. with:
  59. android_version: ${{ steps.parse.outputs.android_version }}
  60. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  61. os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
  62. use_repo: ${{ inputs.use_repo }}
  63. - name: Extract Sublevel and Set File Name
  64. id: extract
  65. uses: ./.github/actions/extract-sublevel-file-name
  66. with:
  67. variant: ${{ inputs.variant }}
  68. - name: Kernel Fixes
  69. uses: ./.github/actions/kernel-fixes
  70. with:
  71. android_version: ${{ steps.parse.outputs.android_version }}
  72. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  73. sublevel: ${{ steps.extract.outputs.sublevel }}
  74. os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
  75. - name: Setup KernelSU-Next
  76. if: contains(inputs.feature_set, 'KSUN') || inputs.feature_set == 'FULL'
  77. uses: ./.github/actions/kernelsu
  78. - name: SUSFS
  79. if: contains(inputs.feature_set, 'SUSFS') || inputs.feature_set == 'FULL'
  80. uses: ./.github/actions/susfs
  81. with:
  82. android_version: ${{ steps.parse.outputs.android_version }}
  83. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  84. os_patch_level: ${{ steps.parse.outputs.os_patch_level }}
  85. sublevel: ${{ steps.extract.outputs.sublevel }}
  86. - name: Baseband Guard
  87. if: contains(inputs.feature_set, 'BBG') || inputs.feature_set == 'FULL'
  88. uses: ./.github/actions/bbg
  89. - name: Setup Networking
  90. if: contains(inputs.feature_set, 'NET') || inputs.feature_set == 'FULL'
  91. uses: ./.github/actions/networking
  92. with:
  93. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  94. android_version: ${{ steps.parse.outputs.android_version }}
  95. - name: DroidSpaces-OSS Patches
  96. if: contains(inputs.feature_set, 'DS') || inputs.feature_set == 'FULL'
  97. uses: ./.github/actions/droidspaces
  98. with:
  99. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  100. - name: Setup Misc Configs
  101. uses: ./.github/actions/misc
  102. with:
  103. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  104. android_version: ${{ steps.parse.outputs.android_version }}
  105. - name: Apply Module Check Bypass
  106. if: ${{ inputs.variant == 'Bypass' }}
  107. uses: ./.github/actions/module-check-bypass
  108. with:
  109. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  110. - name: Apply Device-Specific Patches
  111. uses: ./.github/actions/apply-device-patches
  112. with:
  113. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  114. - name: Apply ABI Compare Bypass
  115. if: false
  116. working-directory: ${{ github.workspace }}/kernel
  117. run: |
  118. # ABI compare bypass per kernel/android version
  119. # Edit each block as needed per version
  120. if [[ "$ANDROID_VERSION" == "android12" && "$KERNEL_VERSION" == "5.10" ]]; then
  121. sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/abi/compare_to_symbol_list
  122. elif [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.10" ]]; then
  123. sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/kernel/abi/compare_to_symbol_list
  124. elif [[ "$ANDROID_VERSION" == "android13" && "$KERNEL_VERSION" == "5.15" ]]; then
  125. sed -i 's/^\s*exit 1$/ echo "Who Cares? Bypassing Now!"/' build/kernel/abi/compare_to_symbol_list
  126. elif [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "5.15" ]]; then
  127. perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
  128. elif [[ "$ANDROID_VERSION" == "android14" && "$KERNEL_VERSION" == "6.1" ]]; then
  129. perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
  130. elif [[ "$ANDROID_VERSION" == "android15" && "$KERNEL_VERSION" == "6.6" ]]; then
  131. perl -i -pe 's/^(\s*)return 1$/$1print("Who Cares? Bypassing Now!")\n$1return 0/g if /if missing_symbols:/../return 1/' build/kernel/abi/check_buildtime_symbol_protection.py
  132. fi
  133. - name: Apply Kernel Branding
  134. uses: ./.github/actions/apply-kernel-branding
  135. with:
  136. variant: ${{ inputs.variant }}
  137. kernel_version: ${{ steps.parse.outputs.kernel_version }}
  138. android_version: ${{ steps.parse.outputs.android_version }}
  139. sublevel: ${{ steps.extract.outputs.sublevel }}
  140. - name: Remove Protected Exports
  141. uses: ./.github/actions/remove-protected-exports
  142. - name: Clean Kernel Flags
  143. uses: ./.github/actions/clean-kernel-flags
  144. - name: Scan and collect patch rejects
  145. id: scan
  146. if: ${{ always() && inputs.variant == 'Normal' }}
  147. uses: ./.github/actions/scan-patch-rejects
  148. - name: Upload Rejects
  149. if: ${{ always() && inputs.variant == 'Normal' }}
  150. uses: actions/upload-artifact@v7
  151. with:
  152. name: ${{ steps.extract.outputs.file_name }}-Rejects
  153. path: patch-rejects/
  154. if-no-files-found: ignore
  155. compression-level: 9
  156. - name: Restore build caches (ccache)
  157. id: restore-ccache
  158. uses: ./.github/actions/restore-cache
  159. with:
  160. cache_path: /home/runner/.ccache
  161. cache_key: buildcache-${{ inputs.kernel_version }}
  162. cache_bucket: "ccache-cache"
  163. compression_level: 9
  164. restore_keys: |
  165. buildcache-
  166. - name: Check ccache hit
  167. run: |
  168. if [ "${{ steps.restore-ccache.outputs.cache-hit }}" = "true" ]; then
  169. echo "✅ ccache HIT - Key: ${{ steps.restore-ccache.outputs.cache-key }} - Size: ${{ steps.restore-ccache.outputs.cache-size }}"
  170. else
  171. echo "❌ ccache MISS - Fresh build"
  172. fi
  173. - name: Restore build caches (bazel)
  174. id: restore-bazel-cache
  175. uses: ./.github/actions/restore-cache
  176. with:
  177. cache_path: /home/runner/.cache/bazel
  178. cache_key: buildcache-${{ inputs.kernel_version }}
  179. cache_bucket: "bazel-cache"
  180. compression_level: 9
  181. restore_keys: |
  182. buildcache-
  183. - name: Check bazel cache hit
  184. run: |
  185. if [ "${{ steps.restore-bazel-cache.outputs.cache-hit }}" = "true" ]; then
  186. echo "✅ bazel cache HIT - Key: ${{ steps.restore-bazel-cache.outputs.cache-key }} - Size: ${{ steps.restore-bazel-cache.outputs.cache-size }}"
  187. else
  188. echo "❌ bazel cache MISS - Fresh build"
  189. fi
  190. - name: Restore build caches (LTO/ld_cache)
  191. id: restore-ldcache
  192. uses: ./.github/actions/restore-cache
  193. with:
  194. cache_path: /home/runner/.ld_cache
  195. cache_key: buildcache-${{ inputs.kernel_version }}
  196. cache_bucket: "lto-cache"
  197. compression_level: 9
  198. restore_keys: |
  199. buildcache-
  200. - name: Check ld_cache hit
  201. run: |
  202. if [ "${{ steps.restore-ldcache.outputs.cache-hit }}" = "true" ]; then
  203. echo "✅ ld_cache HIT - Key: ${{ steps.restore-ldcache.outputs.cache-key }} - Size: ${{ steps.restore-ldcache.outputs.cache-size }}"
  204. else
  205. echo "❌ ld_cache MISS - Fresh build"
  206. fi
  207. - name: Pre-build cache stats
  208. id: pre-cache-stats
  209. run: |
  210. set -euo pipefail
  211. stats=$(ccache -s || true)
  212. pre_hits=$(echo "$stats" | awk '/cache hit/ {h+=$NF} END{print (h+0)}')
  213. pre_misses=$(echo "$stats" | awk '/cache miss/ {m+=$NF} END{print (m+0)}')
  214. echo "pre_hits=$pre_hits" >> $GITHUB_OUTPUT
  215. echo "pre_misses=$pre_misses" >> $GITHUB_OUTPUT
  216. pre_ld_size=$(du -sh "/home/runner/.ld_cache" 2>/dev/null | awk '{print $1}' || echo "0B")
  217. pre_ld_files=$(find "/home/runner/.ld_cache" -type f 2>/dev/null | wc -l || true)
  218. echo "pre_ld_size=$pre_ld_size" >> $GITHUB_OUTPUT
  219. echo "pre_ld_files=$pre_ld_files" >> $GITHUB_OUTPUT
  220. - name: Setup ccache for Android kernel
  221. shell: bash
  222. working-directory: ${{ github.workspace }}
  223. run: |
  224. set -Eeuo pipefail
  225. CCACHE_BIN="/usr/bin/ccache"
  226. CCACHE_URL="https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/ccache/ccache-x86-64"
  227. CCACHE_LINK_DIR="/usr/lib/ccache"
  228. CCACHE_DIR="${HOME}/.ccache"
  229. CCACHE_MAX_SIZE="12G"
  230. echo "== Install ccache =="
  231. if ! sudo test -x "${CCACHE_BIN}"; then
  232. curl -LfsS \
  233. --retry 5 \
  234. --retry-delay 5 \
  235. --retry-all-errors \
  236. --connect-timeout 30 \
  237. -H "User-Agent: Mozilla/5.0" \
  238. "${CCACHE_URL}" \
  239. -o ./ccache
  240. sudo install -m 0755 ./ccache "${CCACHE_BIN}"
  241. rm -f ./ccache
  242. fi
  243. echo "== Create clang symlinks =="
  244. sudo mkdir -p "${CCACHE_LINK_DIR}"
  245. for compiler in clang clang++; do
  246. sudo ln -sf "${CCACHE_BIN}" "${CCACHE_LINK_DIR}/${compiler}"
  247. done
  248. echo "== Export env =="
  249. {
  250. echo "CCACHE_DIR=${CCACHE_DIR}"
  251. echo "CCACHE_EXEC=${CCACHE_BIN}"
  252. echo "CCACHE_BASEDIR=${GITHUB_WORKSPACE}"
  253. echo "CCACHE_COMPRESS=true"
  254. echo "CCACHE_COMPRESSLEVEL=6"
  255. echo "USE_CCACHE=1"
  256. } >> "${GITHUB_ENV}"
  257. mkdir -p "${CCACHE_DIR}"
  258. echo "== Configure ccache =="
  259. "${CCACHE_BIN}" --set-config=cache_dir="${CCACHE_DIR}"
  260. "${CCACHE_BIN}" --set-config=base_dir="${GITHUB_WORKSPACE}"
  261. "${CCACHE_BIN}" --set-config=compression=true
  262. "${CCACHE_BIN}" --set-config=compression_level=6
  263. "${CCACHE_BIN}" --max-size="${CCACHE_MAX_SIZE}"
  264. echo "== Show ccache config =="
  265. "${CCACHE_BIN}" --show-config || true
  266. "${CCACHE_BIN}" --zero-stats || true
  267. "${CCACHE_BIN}" --show-stats || true
  268. - name: 'Setup ccache and Build Environment'
  269. shell: bash
  270. if: false
  271. working-directory: ${{ github.workspace }}
  272. run: |
  273. set -euo pipefail
  274. # Download and install ccache
  275. #echo "Installing ccache..."
  276. #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; }
  277. #sudo cp -f ./ccache /usr/bin/ccache || { echo "❌ Failed to install ccache"; exit 1; }
  278. #sudo chmod +x /usr/bin/ccache
  279. #rm -f ./ccache
  280. # Verify ccache
  281. if ! /usr/bin/ccache --version > /dev/null 2>&1; then
  282. echo "❌ ccache installation failed or binary is corrupted"
  283. exit 1
  284. fi
  285. echo "✅ ccache binary verified: $(/usr/bin/ccache --version | head -1)"
  286. # Setup cache directories
  287. #export CCACHE_DIR="/home/runner/.ccache"
  288. #echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
  289. #export LDCACHE_DIR="/home/runner/.ld_cache"
  290. #echo "LDCACHE_DIR=$LDCACHE_DIR" >> $GITHUB_ENV
  291. #mkdir -p "$CCACHE_DIR" "$LDCACHE_DIR"
  292. # Create LD wrapper for thin-LTO caching
  293. #cat > "$GITHUB_WORKSPACE/kernel/common/ld-wrapper" << 'EOF'
  294. #!/bin/bash
  295. #ld.lld "$@" --thinlto-cache-dir="$LDCACHE_DIR" --thinlto-jobs="$(nproc --all)"
  296. #EOF
  297. #chmod +x "$GITHUB_WORKSPACE/kernel/common/ld-wrapper"
  298. # Setup ccache compiler wrappers in PATH (masquerade method)
  299. # This intercepts compiler invocations regardless of how the build system calls them
  300. #mkdir -p "$GITHUB_WORKSPACE/ccache-bin"
  301. #cp /usr/bin/ccache "$GITHUB_WORKSPACE/ccache-bin/clang"
  302. #cp /usr/bin/ccache "$GITHUB_WORKSPACE/ccache-bin/clang++"
  303. #cp /usr/bin/ccache "$GITHUB_WORKSPACE/ccache-bin/gcc"
  304. #cp /usr/bin/ccache "$GITHUB_WORKSPACE/ccache-bin/g++"
  305. #cp /usr/bin/ccache "$GITHUB_WORKSPACE/ccache-bin/ld.lld"
  306. #chmod +x "$GITHUB_WORKSPACE/ccache-bin"/*
  307. # Export environment variables for subsequent steps
  308. #echo "PATH=$GITHUB_WORKSPACE/ccache-bin:$PATH" >> $GITHUB_ENV
  309. #export CC="/usr/bin/ccache clang"
  310. #echo "CC=$CC" >> $GITHUB_ENV
  311. #export CXX="/usr/bin/ccache clang++"
  312. #echo "CXX=$CXX" >> $GITHUB_ENV
  313. #export HOSTCC="/usr/bin/ccache clang"
  314. #echo "HOSTCC=$HOSTCC" >> $GITHUB_ENV
  315. #export HOSTCXX="/usr/bin/ccache clang++"
  316. #echo "HOSTCXX=$HOSTCXX" >> $GITHUB_ENV
  317. #export LD="$GITHUB_WORKSPACE/kernel/common/ld-wrapper"
  318. #echo "LD=$LD" >> $GITHUB_ENV
  319. #export HOSTLD="$GITHUB_WORKSPACE/kernel/common/ld-wrapper"
  320. #echo "HOSTLD=$HOSTLD" >> $GITHUB_ENV
  321. #echo "CLANG_PREBUILT_BIN=$GITHUB_WORKSPACE/ccache-bin" >> $GITHUB_ENV
  322. export CCACHE_MAXSIZE="12G"
  323. echo CCACHE_MAXSIZE="$CCACHE_MAXSIZE" >> $GITHUB_ENV
  324. export CCACHE_COMPILERCHECK="%compiler% -dumpmachine; %compiler% -dumpversion"
  325. echo CCACHE_COMPILERCHECK="$CCACHE_COMPILERCHECK" >> $GITHUB_ENV
  326. #export CCACHE_BASEDIR="${GITHUB_WORKSPACE}"
  327. #echo CCACHE_BASEDIR="${GITHUB_WORKSPACE}" >> $GITHUB_ENV
  328. export CCACHE_NOHASHDIR="true"
  329. echo CCACHE_NOHASHDIR="true" >> $GITHUB_ENV
  330. #export CCACHE_IGNOREOPTIONS="--sysroot*"
  331. #echo CCACHE_IGNOREOPTIONS="--sysroot*" >> $GITHUB_ENV
  332. #export CCACHE_COMPRESSION="true"
  333. #echo CCACHE_COMPRESSION="true" >> $GITHUB_ENV
  334. #export CCACHE_COMPRESSLEVEL="3"
  335. #echo CCACHE_COMPRESSION_LEVEL="3" >> $GITHUB_ENV
  336. #export CCACHE_DIRECT="true"
  337. #echo CCACHE_DIRECT="true" >> $GITHUB_ENV
  338. #export CCACHE_FILE_CLONE="true"
  339. #echo CCACHE_FILE_CLONE="true" >> $GITHUB_ENV
  340. #export CCACHE_INODE_CACHE="true"
  341. #echo CCACHE_INODE_CACHE="true" >> $GITHUB_ENV
  342. #export CCACHE_IS_KERNEL_COMPILING="true"
  343. #echo CCACHE_IS_KERNEL_COMPILING="true" >> $GITHUB_ENV
  344. #export CCACHE_UMASK="002"
  345. #echo CCACHE_UMASK="002" >> $GITHUB_ENV
  346. #export CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale"
  347. #echo CCACHE_SLOPPINESS="file_macro,time_macros,include_file_mtime,include_file_ctime,pch_defines,system_headers,locale" >> $GITHUB_ENV
  348. export CCACHE_HARDLINK="true"
  349. echo CCACHE_HARDLINK="$CCACHE_HARDLINK" >> $GITHUB_ENV
  350. #if ccache --help 2>&1 | grep -q 'depend_mode'; then
  351. # export CCACHE_DEPEND=true
  352. # echo "CCACHE_DEPEND=true" >> "$GITHUB_ENV"
  353. #fi
  354. # Initialize ccache
  355. #ccache -M 100G
  356. #ccache -p
  357. #ccache -s
  358. #ccache -z
  359. echo "✅ Build environment ready"
  360. echo " CCACHE_DIR: $CCACHE_DIR"
  361. #echo " LDCACHE_DIR: $LDCACHE_DIR"
  362. #echo " Compiler wrappers: $GITHUB_WORKSPACE/ccache-bin"
  363. - name: Build Kernel
  364. env:
  365. SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }}
  366. KBUILD_BUILD_TIMESTAMP: ${{ env.KBUILD_BUILD_TIMESTAMP }}
  367. uses: ./.github/actions/build-kernel
  368. - name: 'Report Cache Sizes'
  369. shell: bash
  370. run: |
  371. set -euo pipefail
  372. echo "📊 Cache sizes after build:"
  373. echo " CCACHE usage:"
  374. du -sh "$CCACHE_DIR" || echo " (no ccache directory)"
  375. #echo " LDCACHE usage:"
  376. #du -sh "$LDCACHE_DIR" || echo " (no ldcache directory)"
  377. echo "Perform cache eviction!"
  378. # 3h = 10800s using seconds to support older ccache
  379. ccache --evict-older-than 10800s
  380. - name: Post-build cache stats
  381. id: post-cache-stats
  382. run: |
  383. set -euo pipefail
  384. stats=$(ccache -s || true)
  385. post_hits=$(echo "$stats" | awk '/cache hit/ {h+=$NF} END{print (h+0)}')
  386. post_misses=$(echo "$stats" | awk '/cache miss/ {m+=$NF} END{print (m+0)}')
  387. pre_hits=${{ steps.pre-cache-stats.outputs.pre_hits }}
  388. pre_misses=${{ steps.pre-cache-stats.outputs.pre_misses }}
  389. delta_hits=$((post_hits - pre_hits)) || true
  390. delta_misses=$((post_misses - pre_misses)) || true
  391. delta_total=$((delta_hits + delta_misses))
  392. if [ "$delta_total" -gt 0 ]; then
  393. percent=$(( delta_hits * 100 / delta_total ))
  394. echo "ccache hit during build: ${percent}% (${delta_hits} hits / ${delta_total} accesses)"
  395. else
  396. echo "No compiler activity detected (no ccache accesses)."
  397. fi
  398. post_ld_size=$(du -sh "/home/runner/.ld_cache" 2>/dev/null | awk '{print $1}' || echo "0B")
  399. post_ld_files=$(find "/home/runner/.ld_cache" -type f 2>/dev/null | wc -l || true)
  400. echo "ld_cache size before: ${{ steps.pre-cache-stats.outputs.pre_ld_size }}, after: $post_ld_size"
  401. echo "ld_cache files before: ${{ steps.pre-cache-stats.outputs.pre_ld_files }}, after: $post_ld_files"
  402. - name: List cache contents
  403. working-directory: ${{ github.workspace }}
  404. run: |
  405. echo "=== .ccache ==="
  406. du -sh /home/runner/.ccache || true
  407. ls -l /home/runner/.ccache || true
  408. echo "=== .cache/bazel ==="
  409. du -sh /home/runner/.cache/bazel || true
  410. ls -l /home/runner/.cache/bazel || true
  411. - name: Save ccache cache
  412. uses: ./.github/actions/save-cache
  413. with:
  414. cache_path: /home/runner/.ccache
  415. cache_key: buildcache-${{ inputs.kernel_version }}
  416. cache_bucket: "ccache-cache"
  417. compression_level: 9
  418. github_token: ${{ secrets.GITHUB_TOKEN }}
  419. - name: Save bazel cache
  420. uses: ./.github/actions/save-cache
  421. with:
  422. cache_path: /home/runner/.cache/bazel
  423. cache_key: buildcache-${{ inputs.kernel_version }}
  424. cache_bucket: "bazel-cache"
  425. compression_level: 9
  426. github_token: ${{ secrets.GITHUB_TOKEN }}
  427. - name: Save LTO LD cache
  428. uses: ./.github/actions/save-cache
  429. with:
  430. cache_path: /home/runner/.ld_cache
  431. cache_key: buildcache-${{ inputs.kernel_version }}
  432. cache_bucket: "lto-cache"
  433. compression_level: 9
  434. github_token: ${{ secrets.GITHUB_TOKEN }}
  435. - name: Create Bootimgs Folder and Build Boot Images
  436. uses: ./.github/actions/build-boot-images
  437. - name: Upload Boot Image (boot.img)
  438. uses: actions/upload-artifact@v7
  439. with:
  440. path: ${{ github.workspace }}/boot-artifacts/${{ steps.extract.outputs.file_name }}-boot.img
  441. if-no-files-found: error
  442. archive: false
  443. - name: Upload Boot Image (boot-gz.img)
  444. uses: actions/upload-artifact@v7
  445. with:
  446. path: ${{ github.workspace }}/boot-artifacts/${{ steps.extract.outputs.file_name }}-boot-gz.img
  447. if-no-files-found: error
  448. archive: false
  449. - name: Upload Boot Image (boot-lz4.img)
  450. uses: actions/upload-artifact@v7
  451. with:
  452. path: ${{ github.workspace }}/boot-artifacts/${{ steps.extract.outputs.file_name }}-boot-lz4.img
  453. if-no-files-found: error
  454. archive: false
  455. - name: Prepare AnyKernel3 Zip
  456. uses: ./.github/actions/prepare-anykernel3
  457. - name: Upload Artifacts
  458. uses: actions/upload-artifact@v7
  459. with:
  460. name: ${{ steps.extract.outputs.file_name }}-AnyKernel3
  461. path: ${{ github.workspace }}/AnyKernel3/**
  462. if-no-files-found: ignore
  463. compression-level: 9