@@ -4,17 +4,27 @@ on: [push]
44permissions :
55 contents : read
66 actions : read
7+ packages : read
78
89jobs :
910 build :
10- name : Build x86_64
11+ name : Build kernel
1112 runs-on : kernel-build
1213
1314 steps :
14- - name : Checkout code
15+ - name : Checkout kernel source
1516 uses : actions/checkout@v4
1617 with :
1718 fetch-depth : 1
19+ path : kernel-src-tree
20+
21+ - name : Checkout kernel-container-build (test branch)
22+ uses : actions/checkout@v4
23+ with :
24+ repository : ctrliq/kernel-container-build
25+ ref : test-stage-separation
26+ path : kernel-container-build
27+ token : ${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }}
1828
1929 # Host deps + KVM / FUSE validation
2030 - name : Install host dependencies & verify KVM/FUSE
@@ -30,22 +40,24 @@ jobs:
3040 sudo chmod 0666 /dev/kvm
3141 fi
3242
33- # Kernel build inside CIQ builder
43+ # Kernel build inside CIQ builder (build only, no test)
3444 - name : Build kernel inside CIQ builder container
3545 run : |
3646 set -euxo pipefail
3747 mkdir -p output
3848 df -h
3949 cat /proc/cpuinfo
50+ chmod +x kernel-container-build/build-container/*.sh
4051 podman run --rm --pull=always \
4152 --privileged \
4253 --device=/dev/fuse \
4354 $([ -e /dev/kvm ] && echo "--device=/dev/kvm") \
44- -v "$PWD":/src \
55+ -v "$PWD/kernel-src-tree ":/src \
4556 -v "$PWD/output":/output \
57+ -v "$PWD/kernel-container-build/build-container":/usr/local/build-scripts:ro \
4658 --security-opt label=disable \
4759 pulp.prod.ciq.dev/ciq/cicd/lts-images/builder \
48- build_kernel.sh -c lts-9.2-kernel-builder 2>&1 | tee output/kernel-build.log
60+ /usr/local/build-scripts/ build_kernel.sh -c lts-9.2-kernel-builder 2>&1 | tee output/kernel-build.log
4961 sudo dmesg
5062
5163 # Upload kernel compilation logs
@@ -57,24 +69,123 @@ jobs:
5769 path : output/kernel-build.log
5870 retention-days : 7
5971
60- # Upload kselftest logs
61- - name : Upload kselftest logs
72+ # Upload qcow2 image for next stages
73+ - name : Upload qcow2 image
6274 uses : actions/upload-artifact@v4
6375 if : always()
6476 with :
65- name : kselftest-logs -x86_64
77+ name : kernel-qcow2-image -x86_64
6678 path : |
67- output/kselftests-*.log
68- output/dmesg-*.log
79+ output/*.qcow2
80+ output/last_build_image.txt
6981 retention-days : 7
7082
71- # Upload qcow2 image
72- - name : Upload qcow2 image
83+ boot :
84+ name : Boot verification
85+ runs-on : kernel-build
86+ needs : build
87+
88+ steps :
89+ - name : Checkout kernel-container-build (test branch)
90+ uses : actions/checkout@v4
91+ with :
92+ repository : ctrliq/kernel-container-build
93+ ref : test-stage-separation
94+ path : kernel-container-build
95+ token : ${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }}
96+
97+ - name : Install host dependencies
98+ run : |
99+ set -euxo pipefail
100+ sudo apt-get update
101+ sudo apt-get install -y fuse3 cpu-checker podman
102+ sudo modprobe fuse
103+ if [ -e /dev/kvm ]; then
104+ sudo chmod 0666 /dev/kvm
105+ fi
106+
107+ - name : Download qcow2 image
108+ uses : actions/download-artifact@v4
109+ with :
110+ name : kernel-qcow2-image-x86_64
111+ path : output
112+
113+ # Boot verification test
114+ - name : Boot kernel and verify
115+ run : |
116+ set -euxo pipefail
117+ chmod +x kernel-container-build/build-container/*.sh
118+ podman run --rm --pull=always \
119+ --privileged \
120+ --device=/dev/fuse \
121+ $([ -e /dev/kvm ] && echo "--device=/dev/kvm") \
122+ -v "$PWD/output":/output \
123+ -v "$PWD/kernel-container-build/build-container":/usr/local/build-scripts:ro \
124+ --security-opt label=disable \
125+ pulp.prod.ciq.dev/ciq/cicd/lts-images/builder \
126+ /usr/local/build-scripts/boot_kernel.sh
127+
128+ # Upload boot logs
129+ - name : Upload boot logs
73130 uses : actions/upload-artifact@v4
74131 if : always()
132+ with :
133+ name : boot-logs-x86_64
134+ path : output/boot-*.log
135+ retention-days : 7
136+
137+ test-kselftest :
138+ name : Run kselftests
139+ runs-on : kernel-build
140+ needs : boot
141+
142+ steps :
143+ - name : Checkout kernel-container-build (test branch)
144+ uses : actions/checkout@v4
145+ with :
146+ repository : ctrliq/kernel-container-build
147+ ref : test-stage-separation
148+ path : kernel-container-build
149+ token : ${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }}
150+
151+ - name : Install host dependencies
152+ run : |
153+ set -euxo pipefail
154+ sudo apt-get update
155+ sudo apt-get install -y fuse3 cpu-checker podman
156+ sudo modprobe fuse
157+ if [ -e /dev/kvm ]; then
158+ sudo chmod 0666 /dev/kvm
159+ fi
160+
161+ - name : Download qcow2 image
162+ uses : actions/download-artifact@v4
75163 with :
76164 name : kernel-qcow2-image-x86_64
165+ path : output
166+
167+ # Run kselftests
168+ - name : Execute kselftests
169+ run : |
170+ set -euxo pipefail
171+ chmod +x kernel-container-build/build-container/*.sh
172+ podman run --rm --pull=always \
173+ --privileged \
174+ --device=/dev/fuse \
175+ $([ -e /dev/kvm ] && echo "--device=/dev/kvm") \
176+ -v "$PWD/output":/output \
177+ -v "$PWD/kernel-container-build/build-container":/usr/local/build-scripts:ro \
178+ --security-opt label=disable \
179+ pulp.prod.ciq.dev/ciq/cicd/lts-images/builder \
180+ /usr/local/build-scripts/test_kselftests.sh
181+
182+ # Upload kselftest logs
183+ - name : Upload kselftest logs
184+ uses : actions/upload-artifact@v4
185+ if : always()
186+ with :
187+ name : kselftest-logs-x86_64
77188 path : |
78- output/*.qcow2
79- output/last_build_image.txt
189+ output/kselftests-*.log
190+ output/dmesg-*.log
80191 retention-days : 7
0 commit comments