Improve build_system.sh mounting and caching #102
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: build kernel and system | |
runs-on: namespace-profile-arm64-8x16-2004-caching | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Get kernel submodule ref | |
id: kernel-submodule | |
run: echo "ref=$(git ls-tree HEAD | awk '$4 == "agnos-kernel-sdm845"' | awk '{print $3}')" >> "$GITHUB_OUTPUT" | |
- name: Restore cache output boot.img and *.ko | |
id: cache-output | |
uses: actions/cache/restore@v4 | |
with: | |
key: output-${{ steps.kernel-submodule.outputs.ref }} | |
path: | | |
output/boot.img | |
output/*.ko | |
- name: Checkout agnos-kernel-sdm845 | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: commaai/agnos-kernel-sdm845 | |
ref: ${{ steps.kernel-submodule.outputs.ref }} | |
path: agnos-kernel-sdm845 | |
- name: Restore cache kernel build | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
uses: actions/cache/restore@v4 | |
with: | |
key: kernel-out | |
path: agnos-kernel-sdm845/out | |
- name: Build kernel | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
run: ./build_kernel.sh | |
- name: Save cache kernel build | |
uses: actions/cache/save@v4 | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
with: | |
key: kernel-out | |
path: agnos-kernel-sdm845/out | |
- name: Save cache output boot.img and *.ko | |
uses: actions/cache/save@v4 | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
with: | |
key: output-${{ steps.kernel-submodule.outputs.ref }} | |
path: | | |
output/boot.img | |
output/*.ko | |
- name: Upload artifact boot.img | |
uses: actions/upload-artifact@v4 | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
with: | |
name: boot.img | |
path: output/boot.img | |
- name: Upload artifact kernel modules | |
uses: actions/upload-artifact@v4 | |
if: steps.cache-output.outputs.cache-hit != 'true' | |
with: | |
name: kernel-modules | |
path: output/*.ko | |
- name: Build system | |
run: ./build_system.sh | |
- name: Upload artifact system.img | |
uses: actions/upload-artifact@v4 | |
with: | |
name: system.img | |
path: output/system.img |