Add kernel syscall-prune build cycle with cached profile reuse #49
Workflow file for this run
This file contains hidden or 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: [main, master] | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: build-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build image | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 360 | |
| steps: | |
| - name: Check out sources | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| bc \ | |
| bison \ | |
| build-essential \ | |
| ca-certificates \ | |
| cpio \ | |
| flex \ | |
| git \ | |
| libelf-dev \ | |
| libncurses-dev \ | |
| libssl-dev \ | |
| texinfo \ | |
| wget \ | |
| xz-utils | |
| - name: Restore source downloads cache | |
| id: restore-downloads | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: downloads | |
| key: downloads-linux-${{ hashFiles('build.sh') }} | |
| - name: Restore build workspace cache | |
| id: restore-workspace | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: | | |
| .build-state | |
| bootwrapper | |
| busybox-* | |
| elf2flt-* | |
| gcc-* | |
| linux-* | |
| rootfs | |
| toolchain | |
| uClibc-ng-* | |
| binutils-* | |
| key: workspace-linux-${{ github.ref_name }}-${{ hashFiles('build.sh', 'configs/**', 'patches/**', 'tools/**') }} | |
| restore-keys: | | |
| workspace-linux-${{ github.ref_name }}- | |
| workspace-linux-${{ github.base_ref }}- | |
| workspace-linux-main- | |
| - name: Build image | |
| id: build-image | |
| env: | |
| QUIET: 1 | |
| run: ./build.sh | |
| - name: Build diagnostic subsystem rollup | |
| if: success() | |
| env: | |
| QUIET: 1 | |
| KERNEL_DEBUG_INFO: reduced | |
| run: ./build.sh linux bootwrapper | |
| - name: Render subsystem rollup markdown | |
| if: success() | |
| run: | | |
| python3 scripts/rollup-to-markdown.py \ | |
| --rollup profiles/kernel-pgo/none/subsystem-rollup.txt \ | |
| --budget-status profiles/kernel-pgo/none/subsystem-budget.txt \ | |
| --top 12 \ | |
| --output profiles/kernel-pgo/none/subsystem-rollup.md | |
| - name: Add subsystem rollup to step summary | |
| if: success() | |
| run: cat profiles/kernel-pgo/none/subsystem-rollup.md >> "$GITHUB_STEP_SUMMARY" | |
| - name: Save source downloads cache | |
| if: always() && steps.restore-downloads.outputs.cache-hit != 'true' | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: downloads | |
| key: downloads-linux-${{ hashFiles('build.sh') }} | |
| - name: Save build workspace cache | |
| if: always() && steps.restore-workspace.outputs.cache-hit != 'true' && steps.build-image.outcome == 'success' | |
| uses: actions/cache/save@v5 | |
| with: | |
| path: | | |
| .build-state | |
| bootwrapper | |
| busybox-* | |
| elf2flt-* | |
| gcc-* | |
| linux-* | |
| rootfs | |
| toolchain | |
| uClibc-ng-* | |
| binutils-* | |
| key: workspace-linux-${{ github.ref_name }}-${{ hashFiles('build.sh', 'configs/**', 'patches/**', 'tools/**') }} | |
| - name: Summarize cache reuse | |
| if: always() | |
| run: | | |
| { | |
| echo "### Cache summary" | |
| echo | |
| echo "- downloads cache hit: ${{ steps.restore-downloads.outputs.cache-hit }}" | |
| echo "- workspace cache hit: ${{ steps.restore-workspace.outputs.cache-hit }}" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload build image | |
| if: success() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: bootable-image | |
| compression-level: 0 | |
| path: bootwrapper/linux.axf | |
| - name: Upload build logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-logs | |
| compression-level: 0 | |
| path: | | |
| logs | |
| if-no-files-found: ignore | |
| - name: Upload subsystem rollup artifacts | |
| if: success() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: subsystem-rollup | |
| compression-level: 0 | |
| path: | | |
| profiles/kernel-pgo/none/subsystem-rollup.txt | |
| profiles/kernel-pgo/none/subsystem-rollup.md | |
| profiles/kernel-pgo/none/subsystem-budget.txt | |
| profiles/kernel-pgo/none/subsystem-rollup-tree.html | |
| profiles/kernel-pgo/none/subsystem-rollup-deep.html | |
| profiles/kernel-pgo/none/subsystem-rollup-bars.svg | |
| if-no-files-found: warn | |
| qemu: | |
| name: Validate boot in QEMU | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| needs: build | |
| steps: | |
| - name: Check out sources | |
| uses: actions/checkout@v6 | |
| - name: Install QEMU dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| expect \ | |
| qemu-system-arm | |
| - name: Download build image | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: bootable-image | |
| path: bootwrapper | |
| - name: Validate boot in QEMU | |
| run: scripts/validate-qemu.sh bootwrapper/linux.axf qemu.log | |
| - name: Upload QEMU logs | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: qemu-logs | |
| compression-level: 0 | |
| path: | | |
| qemu.log | |
| if-no-files-found: ignore |