ci: add GitHub Action to build kvm_x86_64 ONIE image #1
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 ONIE (kvm_x86_64) | |
| # Builds the generic amd64 ONIE image for the kvm_x86_64 target, intended | |
| # to run as a VM under KVM/QEMU. The build follows the upstream-recommended | |
| # containerized flow (see contrib/build-env and machine/kvm_x86_64/INSTALL), | |
| # with secure boot disabled so no signing keys are required. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - 'build-config/**' | |
| - 'machine/kvm_x86_64/**' | |
| - '.github/workflows/build-onie.yml' | |
| - '.github/onie-build/**' | |
| pull_request: | |
| paths: | |
| - 'build-config/**' | |
| - 'machine/kvm_x86_64/**' | |
| - '.github/workflows/build-onie.yml' | |
| - '.github/onie-build/**' | |
| jobs: | |
| build: | |
| name: Build kvm_x86_64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build the ONIE build-environment image | |
| run: | | |
| docker build \ | |
| -t onie-build-env \ | |
| --build-arg UID=$(id -u) \ | |
| --build-arg GID=$(id -g) \ | |
| .github/onie-build | |
| - name: Disable secure boot in the kernel config | |
| # The kvm_x86_64 kernel config defaults to expecting signing keys. | |
| # The repo ships a config-insecure variant for non-secure-boot builds. | |
| run: cp machine/kvm_x86_64/kernel/config-insecure machine/kvm_x86_64/kernel/config | |
| - name: Build ONIE | |
| run: | | |
| docker run --rm --privileged \ | |
| -v "${PWD}:/onie" \ | |
| onie-build-env \ | |
| bash -lc 'cd build-config && make -j"$(nproc)" \ | |
| MACHINE=kvm_x86_64 \ | |
| SECURE_BOOT_ENABLE=no \ | |
| SECURE_BOOT_EXT=no \ | |
| SECURE_GRUB=no \ | |
| all recovery-iso' |