|
| 1 | +name: Automated kernel build and test |
| 2 | +on: [push] |
| 3 | + |
| 4 | +permissions: |
| 5 | + contents: read |
| 6 | + actions: read |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + name: Build ${{ matrix.runner == 'kernel-build' && 'x86_64' || 'aarch64' }} |
| 11 | + runs-on: ${{ matrix.runner }} |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + runner: [kernel-build, kernel-build-arm64] |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 1 |
| 22 | + |
| 23 | + # Host deps + KVM / FUSE validation |
| 24 | + - name: Install host dependencies & verify KVM/FUSE |
| 25 | + run: | |
| 26 | + set -euxo pipefail |
| 27 | + sudo apt-get update |
| 28 | + sudo apt-get install -y fuse3 cpu-checker podman |
| 29 | + sudo modprobe fuse # guarantee /dev/fuse |
| 30 | + if ! sudo kvm-ok ; then |
| 31 | + echo "::warning::KVM acceleration not available on this runner." |
| 32 | + fi |
| 33 | +
|
| 34 | + # Kernel build inside CIQ builder |
| 35 | + - name: Build kernel inside CIQ builder container |
| 36 | + run: | |
| 37 | + set -euxo pipefail |
| 38 | + mkdir -p output |
| 39 | + df -h |
| 40 | + cat /proc/cpuinfo |
| 41 | + podman run --rm --pull=always \ |
| 42 | + --privileged \ |
| 43 | + --device=/dev/fuse \ |
| 44 | + --device=/dev/kvm \ |
| 45 | + -v "$PWD":/src \ |
| 46 | + -v "$PWD/output":/output \ |
| 47 | + --security-opt label=disable \ |
| 48 | + pulp.prod.ciq.dev/ciq/cicd/lts-images/builder \ |
| 49 | + build_kernel.sh |
| 50 | +
|
| 51 | + # Artifacts: qcow2 + metadata |
| 52 | + - name: Upload QCOW2 and metadata |
| 53 | + uses: actions/upload-artifact@v4 |
| 54 | + with: |
| 55 | + name: kernel-build-${{ matrix.runner == 'kernel-build' && 'x86_64' || 'aarch64' }} |
| 56 | + path: | |
| 57 | + output/*.qcow2 |
| 58 | + output/last_build_image.txt |
| 59 | + retention-days: 7 |
| 60 | + if-no-files-found: warn |
| 61 | + |
| 62 | + # Artifacts: logs |
| 63 | + - name: Upload build & dmesg logs |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: kernel-logs-${{ matrix.runner == 'kernel-build' && 'x86_64' || 'aarch64' }} |
| 67 | + path: | |
| 68 | + output/*.log |
| 69 | + retention-days: 7 |
| 70 | + if-no-files-found: warn |
0 commit comments