diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index 191d2cca5..d29eecd22 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -8,16 +8,25 @@ jobs: name: Build Linux runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + id: restore-cached-kernel + with: + path: data/build/arch/x86/boot/bzImage + 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/ - - name: Install required tools + - if: steps.restore-cached-kernel.outputs.cache-hit != 'true' + name: Install required tools run: sudo apt-get install -y libelf-dev - - name: Build kernel + - if: steps.restore-cached-kernel.outputs.cache-hit != 'true' + name: Build kernel run: | config=$(readlink --canonicalize-existing data/config) build=$(pwd)/build/ @@ -33,7 +42,13 @@ jobs: 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: kernel - path: data/build/arch/x86_64/boot/bzImage + name: linux-kernel-image + if-no-files-found: error + path: data/build/arch/x86/boot/bzImage