Skip to content

Commit

Permalink
Update gki-kernel.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWildJames authored Feb 10, 2025
1 parent 271e4e5 commit a5fc222
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/gki-kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
echo "CONFIG set to: $CONFIG"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up cache for toolchain
uses: actions/cache@v4
id: cache-toolchain
Expand All @@ -74,13 +78,19 @@ jobs:
mkbootimg
key: toolchain-${{ runner.os }}-v1

- name: Restore prebuilt toolchain from cache (if available)
if: steps.cache-toolchain.outputs.cache-hit == 'true'
- name: Check if toolchain is already cached or exists
id: check-toolchain
run: |
echo "Toolchain restored from cache."
if [ -d "./kernel-build-tools" ] && [ -d "./mkbootimg" ]; then
echo "Toolchain already exists. Skipping download."
echo "cache-hit=true" >> $GITHUB_ENV
else
echo "Toolchain not found. Will download."
echo "cache-hit=false" >> $GITHUB_ENV
fi
- name: Use prebuilt toolchain (if cache is missing, download)
if: steps.cache-toolchain.outputs.cache-hit != 'true'
- name: Download prebuilt toolchain (if cache is missing)
if: env.cache-hit == 'false'
run: |
AOSP_MIRROR=https://android.googlesource.com
BRANCH=main-kernel-build-2024
Expand All @@ -94,6 +104,15 @@ jobs:
rm -rf $TEMP_DIR
- name: Save toolchain to cache
if: env.cache-hit == 'false'
uses: actions/cache@v4
with:
path: |
kernel-build-tools
mkbootimg
key: toolchain-${{ runner.os }}-v1

- name: Set environment variables
run: |
echo "AVBTOOL=$GITHUB_WORKSPACE/kernel-build-tools/linux-x86/bin/avbtool" >> $GITHUB_ENV
Expand Down

0 comments on commit a5fc222

Please sign in to comment.