@@ -7,14 +7,22 @@ permissions:
77
88jobs :
99 build :
10- name : Build x86_64
10+ name : Build kernel
1111 runs-on : kernel-build
1212
1313 steps :
14- - name : Checkout code
14+ - name : Checkout kernel source
1515 uses : actions/checkout@v4
1616 with :
1717 fetch-depth : 1
18+ path : kernel-src-tree
19+
20+ - name : Checkout kernel-container-build (test branch)
21+ uses : actions/checkout@v4
22+ with :
23+ repository : ctrliq/kernel-container-build
24+ ref : test-stage-separation
25+ path : kernel-container-build
1826
1927 # Host deps + KVM / FUSE validation
2028 - name : Install host dependencies & verify KVM/FUSE
3038 sudo chmod 0666 /dev/kvm
3139 fi
3240
33- # Kernel build inside CIQ builder
41+ # Kernel build inside CIQ builder (build only, no test)
3442 - name : Build kernel inside CIQ builder container
3543 run : |
3644 set -euxo pipefail
@@ -41,11 +49,12 @@ jobs:
4149 --privileged \
4250 --device=/dev/fuse \
4351 $([ -e /dev/kvm ] && echo "--device=/dev/kvm") \
44- -v "$PWD":/src \
52+ -v "$PWD/kernel-src-tree ":/src \
4553 -v "$PWD/output":/output \
54+ -v "$PWD/kernel-container-build/build-container":/usr/local/build-scripts:ro \
4655 --security-opt label=disable \
4756 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
57+ /usr/local/build-scripts/ build_kernel.sh -c lts-9.2-kernel-builder 2>&1 | tee output/kernel-build.log
4958 sudo dmesg
5059
5160 # Upload kernel compilation logs
@@ -57,24 +66,119 @@ jobs:
5766 path : output/kernel-build.log
5867 retention-days : 7
5968
60- # Upload kselftest logs
61- - name : Upload kselftest logs
69+ # Upload qcow2 image for next stages
70+ - name : Upload qcow2 image
6271 uses : actions/upload-artifact@v4
6372 if : always()
6473 with :
65- name : kselftest-logs -x86_64
74+ name : kernel-qcow2-image -x86_64
6675 path : |
67- output/kselftests-*.log
68- output/dmesg-*.log
76+ output/*.qcow2
77+ output/last_build_image.txt
6978 retention-days : 7
7079
71- # Upload qcow2 image
72- - name : Upload qcow2 image
80+ boot :
81+ name : Boot verification
82+ runs-on : kernel-build
83+ needs : build
84+
85+ steps :
86+ - name : Checkout kernel-container-build (test branch)
87+ uses : actions/checkout@v4
88+ with :
89+ repository : ctrliq/kernel-container-build
90+ ref : test-stage-separation
91+ path : kernel-container-build
92+
93+ - name : Install host dependencies
94+ run : |
95+ set -euxo pipefail
96+ sudo apt-get update
97+ sudo apt-get install -y fuse3 cpu-checker podman
98+ sudo modprobe fuse
99+ if [ -e /dev/kvm ]; then
100+ sudo chmod 0666 /dev/kvm
101+ fi
102+
103+ - name : Download qcow2 image
104+ uses : actions/download-artifact@v4
105+ with :
106+ name : kernel-qcow2-image-x86_64
107+ path : output
108+
109+ # Boot verification test
110+ - name : Boot kernel and verify
111+ run : |
112+ set -euxo pipefail
113+ podman run --rm --pull=always \
114+ --privileged \
115+ --device=/dev/fuse \
116+ $([ -e /dev/kvm ] && echo "--device=/dev/kvm") \
117+ -v "$PWD/output":/output \
118+ -v "$PWD/kernel-container-build/build-container":/usr/local/build-scripts:ro \
119+ --security-opt label=disable \
120+ pulp.prod.ciq.dev/ciq/cicd/lts-images/builder \
121+ /usr/local/build-scripts/boot_kernel.sh
122+
123+ # Upload boot logs
124+ - name : Upload boot logs
73125 uses : actions/upload-artifact@v4
74126 if : always()
127+ with :
128+ name : boot-logs-x86_64
129+ path : output/boot-*.log
130+ retention-days : 7
131+
132+ test-kselftest :
133+ name : Run kselftests
134+ runs-on : kernel-build
135+ needs : boot
136+
137+ steps :
138+ - name : Checkout kernel-container-build (test branch)
139+ uses : actions/checkout@v4
140+ with :
141+ repository : ctrliq/kernel-container-build
142+ ref : test-stage-separation
143+ path : kernel-container-build
144+
145+ - name : Install host dependencies
146+ run : |
147+ set -euxo pipefail
148+ sudo apt-get update
149+ sudo apt-get install -y fuse3 cpu-checker podman
150+ sudo modprobe fuse
151+ if [ -e /dev/kvm ]; then
152+ sudo chmod 0666 /dev/kvm
153+ fi
154+
155+ - name : Download qcow2 image
156+ uses : actions/download-artifact@v4
75157 with :
76158 name : kernel-qcow2-image-x86_64
159+ path : output
160+
161+ # Run kselftests
162+ - name : Execute kselftests
163+ run : |
164+ set -euxo pipefail
165+ podman run --rm --pull=always \
166+ --privileged \
167+ --device=/dev/fuse \
168+ $([ -e /dev/kvm ] && echo "--device=/dev/kvm") \
169+ -v "$PWD/output":/output \
170+ -v "$PWD/kernel-container-build/build-container":/usr/local/build-scripts:ro \
171+ --security-opt label=disable \
172+ pulp.prod.ciq.dev/ciq/cicd/lts-images/builder \
173+ /usr/local/build-scripts/test_kselftests.sh
174+
175+ # Upload kselftest logs
176+ - name : Upload kselftest logs
177+ uses : actions/upload-artifact@v4
178+ if : always()
179+ with :
180+ name : kselftest-logs-x86_64
77181 path : |
78- output/*.qcow2
79- output/last_build_image.txt
182+ output/kselftests-*.log
183+ output/dmesg-*.log
80184 retention-days : 7
0 commit comments