Skip to content

Caching etc

Caching etc #6

Workflow file for this run

name: Build Linux
on:
push:
jobs:
build:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/cache/restore@v4
id: restore-cached-kernel
with:
key: linux-kernel
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'torvalds/linux'
ref: v6.6
fetch-depth: 1
path: linux/
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
name: Install required tools
run: sudo apt-get install -y libelf-dev
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
name: Build kernel
run: |
config=$(readlink --canonicalize-existing data/config)
build=$(pwd)/build/
cd linux/
export KBUILD_OUTPUT="${build}"
mkdir "${KBUILD_OUTPUT}"
KCONFIG_ALLCONFIG="${config}" make O="${KBUILD_OUTPUT}" allnoconfig
echo "::group::config"
cat "${KBUILD_OUTPUT}/.config"
echo "::endgroup::"
make O="${KBUILD_OUTPUT}" -j8
- if: steps.restore-cached-kernel.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: data/build/arch/x86/boot/bzImage
key: linux-kernel
- uses: actions/upload-artifact@v4
with:
name: linux-kernel-image
if-no-files-found: error
path: data/build/arch/x86/boot/bzImage