Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
34e99df
feat: add author-named kernel source dropdown for LOS trees
mohdakil2426 Jul 12, 2026
96b9e74
fix: repair matrix YAML and shellcheck empty SOURCE_REF
mohdakil2426 Jul 12, 2026
9828db0
fix: keep release display lookup YAML-safe
mohdakil2426 Jul 12, 2026
3746cf5
fix: drop unused default on required kernel_source input
mohdakil2426 Jul 12, 2026
d9686ed
docs: recommend LLVM 22 for LOS armv9 kernel sources
mohdakil2426 Jul 12, 2026
4201af5
fix: cap LLVM 22 parallelism to avoid free-runner OOM
mohdakil2426 Jul 12, 2026
16a9b1d
fix: disable Clang LTO for LOS gki_fragments on free runners
mohdakil2426 Jul 12, 2026
d636073
test: add LTO input validation
mohdakil2426 Jul 12, 2026
4c8ca1d
ci: add lto workflow input and pass-through
mohdakil2426 Jul 12, 2026
5e7cb5b
ci: add 16GiB swap and stronger cleanup for LTO builds
mohdakil2426 Jul 12, 2026
8fe9937
feat: apply selectable Clang LTO modes in kernel build
mohdakil2426 Jul 12, 2026
139d7dd
ci: enlarge ccache and include LTO in cache identity
mohdakil2426 Jul 12, 2026
5ce3a96
ci: streamline matrix setup tests and upload summary artifact
mohdakil2426 Jul 12, 2026
3bbebb5
docs: document LTO modes, ccache, and free-runner guidance
mohdakil2426 Jul 12, 2026
8d18663
ci: Wild-style ThinLTO cache, richer ccache restore-keys, aggressive …
mohdakil2426 Jul 12, 2026
d922e52
docs: align README and versions with multi-kernel, LTO, and cache state
mohdakil2426 Jul 12, 2026
7d16811
feat: multi-kernel ZIP naming, text banner, auto toolchain, pipeline …
mohdakil2426 Jul 12, 2026
56b0ec6
fix(ci): save ccache/ThinLTO on failed builds (!cancelled)
mohdakil2426 Jul 12, 2026
f70db37
feat(summary): show LTO, toolchain, package family in matrix configur…
mohdakil2426 Jul 12, 2026
6372ec9
fix(summary): drop hardcoded Pzqqt credits; gate SUSFS sections on en…
mohdakil2426 Jul 12, 2026
1715249
feat(summary): CI-only Cache section; strip from release notes; toolc…
mohdakil2426 Jul 12, 2026
87cff61
chore: ignore local matrix-summary scratch files
mohdakil2426 Jul 12, 2026
338cb9d
feat: Wild-style manager version (rev-list + BASE inject) with Makefi…
mohdakil2426 Jul 13, 2026
81e17db
feat(summary): link kernel source id to repo; embed full ccache -s in…
mohdakil2426 Jul 13, 2026
527f010
docs: final alignment for multi-kernel merge (README, matrix preview,…
mohdakil2426 Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 98 additions & 21 deletions .github/workflows/build-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
description: Uploaded flash artifact name
value: ${{ jobs.build.outputs.flash_artifact_name }}
inputs:
source_repo:
kernel_source:
required: true
type: string
source_ref:
required: true
required: false
type: string
default: ""
manager:
required: true
type: string
Expand Down Expand Up @@ -46,7 +47,11 @@ on:
toolchain:
required: false
type: string
default: android-r416183b
default: auto
lto:
required: false
type: string
default: thin
artifact_label:
required: true
type: string
Expand All @@ -71,7 +76,7 @@ jobs:
flash_artifact_name: ${{ steps.artifact-name.outputs.name }}
env:
GH_TOKEN: ${{ github.token }}
SOURCE_REPO: ${{ inputs.source_repo }}
KERNEL_SOURCE: ${{ inputs.kernel_source }}
SOURCE_REF: ${{ inputs.source_ref }}
MANAGER: ${{ inputs.manager }}
MANAGER_REF: ${{ inputs.manager_ref }}
Expand All @@ -85,6 +90,7 @@ jobs:
CCACHE_DIR: /home/runner/.ccache
USE_CCACHE: ${{ inputs.enable_ccache }}
TOOLCHAIN: ${{ inputs.toolchain }}
LTO: ${{ inputs.lto }}
ANDROID_CLANG_BIN: ${{ github.workspace }}/android-clang/clang-r416183b/bin
LLVM_22_1_8_BIN: ${{ github.workspace }}/llvm-22.1.8/bin

Expand All @@ -98,19 +104,26 @@ jobs:
if: ${{ inputs.run_policy_tests }}
run: |
for test_script in tests/test-*.sh; do
env -u SOURCE_REPO -u SOURCE_REF -u MANAGER -u MANAGER_REF -u ENABLE_SUSFS \
env -u SOURCE_REPO -u SOURCE_REF -u KERNEL_SOURCE -u MANAGER -u MANAGER_REF -u ENABLE_SUSFS \
-u SUSFS_VERSION -u SUSFS_KERNEL_BRANCH -u SUSFS_REF -u SUSFS_EXPECTED_VERSION \
bash "${test_script}"
done

- name: Resolve kernel source preset
id: kernel-source
run: bash scripts/resolve-kernel-source.sh

- name: Resolve toolchain
run: bash scripts/resolve-toolchain.sh

- name: Validate inputs
run: bash scripts/validate-inputs.sh

- name: Checkout kernel source
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: ${{ inputs.source_repo }}
ref: ${{ inputs.source_ref }}
repository: ${{ steps.kernel-source.outputs.source_repo }}
ref: ${{ steps.kernel-source.outputs.source_ref }}
path: kernel-source
fetch-depth: 1
persist-credentials: false
Expand All @@ -120,15 +133,24 @@ jobs:
run: |
available_gib="$(df --output=avail -BG / | tail -n1 | tr -dc '0-9')"
echo "available_gib=${available_gib}" >> "$GITHUB_OUTPUT"
if (( available_gib < 20 )); then
echo "Only ${available_gib} GiB free; removing unused hosted-runner SDKs"
# Wild-style: always free hosted SDKs for kernel builds so LTO + ccache have room.
# More aggressive messaging when free space is already low.
if (( available_gib < 40 )) || [[ "${{ inputs.lto }}" != "none" ]]; then
echo "Freeing hosted-runner SDKs (free=${available_gib} GiB, lto=${{ inputs.lto }})"
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/usr/local/share/boost /usr/share/swift || true
else
echo "${available_gib} GiB free; SDK cleanup not required"
echo "${available_gib} GiB free and LTO=none; light cleanup only"
sudo rm -rf /usr/share/dotnet /opt/ghc || true
fi
df -h /

- name: Setup swap for LTO
if: ${{ inputs.lto != 'none' }}
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0
with:
swap-size-gb: 16

- name: Install build dependencies
run: |
sudo apt-get update
Expand All @@ -138,15 +160,15 @@ jobs:
rsync unzip zip zstd

- name: Restore Android kernel clang
if: ${{ inputs.toolchain == 'android-r416183b' }}
if: ${{ env.TOOLCHAIN == 'android-r416183b' }}
id: android-clang-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: android-clang
key: marble-builder-clang-v3-${{ runner.os }}-${{ runner.arch }}-clang-r416183b-6e3223f

- name: Fetch pinned Android kernel clang
if: ${{ inputs.toolchain == 'android-r416183b' }}
if: ${{ env.TOOLCHAIN == 'android-r416183b' }}
run: |
source config/marble.env
if [[ -x "${ANDROID_CLANG_BIN}/clang" ]]; then
Expand Down Expand Up @@ -181,15 +203,15 @@ jobs:
"${ANDROID_CLANG_BIN}/clang" --version

- name: Restore LLVM 22.1.8
if: ${{ inputs.toolchain == 'llvm-22.1.8' }}
if: ${{ env.TOOLCHAIN == 'llvm-22.1.8' }}
id: llvm-2218-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: llvm-22.1.8
key: marble-builder-llvm-v1-${{ runner.os }}-${{ runner.arch }}-22.1.8-df0e1ecf

- name: Fetch LLVM 22.1.8
if: ${{ inputs.toolchain == 'llvm-22.1.8' }}
if: ${{ env.TOOLCHAIN == 'llvm-22.1.8' }}
run: |
source config/marble.env
if [[ -x "${LLVM_22_1_8_BIN}/clang" ]]; then
Expand Down Expand Up @@ -246,20 +268,32 @@ jobs:

- name: Generate ccache key
id: cache-context
if: ${{ inputs.enable_ccache }}
# Also run for thin LTO so ThinLTO Actions cache keys exist when ccache is disabled.
if: ${{ inputs.enable_ccache || inputs.lto == 'thin' }}
run: |
source config/marble.env
source release/resolved-refs.env
config_hash="$(sha256sum scripts/build-kernel.sh config/marble.env config/managers.json \
config/susfs-refs.json | sha256sum | cut -d' ' -f1)"
config/susfs-refs.json config/kernel-sources.json scripts/resolve-kernel-source.sh \
| sha256sum | cut -d' ' -f1)"
toolchain_id="${ACTIVE_TOOLCHAIN_ID:-${TOOLCHAIN}}"
prefix="marble-builder-ccache-v2-${RUNNER_OS}-${RUNNER_ARCH}-${toolchain_id}-${source_commit}"
manager_prefix="${prefix}-${MANAGER}"
lto_mode="${LTO:-thin}"
kernel_id="${KERNEL_SOURCE:-unknown}"
# v4: richer restore-keys (toolchain+lto, then kernel, then source, then manager).
base="marble-builder-ccache-v4-${RUNNER_OS}-${RUNNER_ARCH}-${toolchain_id}-lto${lto_mode}"
kernel_prefix="${base}-${kernel_id}"
source_prefix="${kernel_prefix}-${source_commit}"
manager_prefix="${source_prefix}-${MANAGER}"
key="${manager_prefix}-${manager_commit:-none}-${susfs_commit:-none}-${BUILD_SCOPE}-${config_hash}"
{
echo "key=${key}"
echo "prefix=${prefix}"
echo "base=${base}"
echo "kernel_prefix=${kernel_prefix}"
echo "source_prefix=${source_prefix}"
echo "manager_prefix=${manager_prefix}"
echo "lto_mode=${lto_mode}"
echo "thinlto_key=marble-builder-thinlto-v1-${RUNNER_OS}-${RUNNER_ARCH}-${toolchain_id}-${kernel_id}-${source_commit}-lto${lto_mode}"
echo "thinlto_prefix=marble-builder-thinlto-v1-${RUNNER_OS}-${RUNNER_ARCH}-${toolchain_id}-${kernel_id}-lto${lto_mode}"
} >> "$GITHUB_OUTPUT"

- name: Restore ccache
Expand All @@ -271,7 +305,19 @@ jobs:
key: ${{ steps.cache-context.outputs.key }}
restore-keys: |
${{ steps.cache-context.outputs.manager_prefix }}-
${{ steps.cache-context.outputs.prefix }}-
${{ steps.cache-context.outputs.source_prefix }}-
${{ steps.cache-context.outputs.kernel_prefix }}-
${{ steps.cache-context.outputs.base }}-

- name: Restore ThinLTO cache
id: thinlto-restore
if: ${{ inputs.lto == 'thin' }}
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /home/runner/.cache/thinlto
key: ${{ steps.cache-context.outputs.thinlto_key }}
restore-keys: |
${{ steps.cache-context.outputs.thinlto_prefix }}-

- name: Apply manager
run: bash scripts/patch-manager.sh
Expand All @@ -295,6 +341,16 @@ jobs:
run: |
cp release/resolved-refs.env kernel-source/release/resolved-refs.env
{
echo "kernel_source=${KERNEL_SOURCE}"
echo "kernel_source_display=${KERNEL_SOURCE_DISPLAY:-}"
echo "kernel_source_author=${KERNEL_SOURCE_AUTHOR:-}"
echo "rom_family=${ROM_FAMILY:-}"
echo "rom_support=${ROM_SUPPORT:-}"
echo "supported_rom_label=${SUPPORTED_ROM_LABEL:-}"
echo "defconfig_mode=${DEFCONFIG_MODE:-}"
echo "defconfig=${DEFCONFIG:-}"
echo "base_defconfig=${BASE_DEFCONFIG:-}"
echo "config_fragments=${CONFIG_FRAGMENTS:-}"
echo "source_repo=${SOURCE_REPO}"
echo "source_ref=${SOURCE_REF}"
echo "source_commit=$(git -C kernel-source rev-parse HEAD)"
Expand All @@ -305,8 +361,18 @@ jobs:
echo "android_clang_commit=${ACTIVE_TOOLCHAIN_COMMIT}"
echo "toolchain=${TOOLCHAIN}"
echo "toolchain_digest=${ACTIVE_TOOLCHAIN_DIGEST}"
echo "lto=${LTO:-thin}"
echo "package_family=${PACKAGE_FAMILY:-}"
echo "quality_channel=${QUALITY_CHANNEL:-experimental}"
if [[ "${KERNEL_SOURCE:-melt}" == "melt" ]]; then
echo "quality_label=melt-stable-candidate"
else
echo "quality_label=los-experimental"
fi
echo "ccache_key=${{ steps.cache-context.outputs.key }}"
echo "ccache_hit=${{ steps.ccache-restore.outputs.cache-hit || 'false' }}"
echo "thinlto_cache_key=${{ steps.cache-context.outputs.thinlto_key }}"
echo "thinlto_cache_hit=${{ steps.thinlto-restore.outputs.cache-hit || 'false' }}"
echo "disk_available_before_build_gib=${{ steps.disk-space.outputs.available_gib }}"
cat kernel-source/release/resolved-refs.env
} > kernel-source/release/build-info.txt
Expand Down Expand Up @@ -350,9 +416,20 @@ jobs:
kernel-source/release/ccache-stats.txt
kernel-source/release/zip-name.env

# Object caches: save even when the build fails (e.g. 90% compile then OOM),
# so the next run can reuse partial work. Never save on cancel. Exact GHA
# keys are immutable — only save when this run did not restore an exact hit.
# Product artifacts (ZIP/release) stay success-only above.
- name: Save ccache
if: ${{ inputs.enable_ccache && success() && steps.ccache-restore.outputs.cache-hit != 'true' }}
if: ${{ always() && inputs.enable_ccache && !cancelled() && steps.ccache-restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ steps.cache-context.outputs.key }}

- name: Save ThinLTO cache
if: ${{ always() && inputs.lto == 'thin' && !cancelled() && steps.thinlto-restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /home/runner/.cache/thinlto
key: ${{ steps.cache-context.outputs.thinlto_key }}
Loading
Loading