Skip to content

Commit b8f2a5b

Browse files
committed
ci: prepare rootfs after building artifacts
Currently, each test job is rebuilding the artifacts. We can do this just once after we built the kernel and prepare the rootfs. The tests than get ran by invoking the vm with "run_tests={test},{test2}" appended to boot command. Signed-off-by: Manu Bretelle <chantr4@gmail.com>
1 parent 64dce15 commit b8f2a5b

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ jobs:
156156
toolchain: ${{ matrix.toolchain }}
157157
kbuild-output: ${{ env.KBUILD_OUTPUT }}
158158
max-make-jobs: 32
159+
- name: Prepare rootfs
160+
uses: libbpf/ci/prepare-rootfs@master
161+
with:
162+
project-name: 'libbpf'
163+
arch: ${{ matrix.arch }}
164+
kernel: ${{ matrix.kernel }}
165+
kernel-root: '.'
166+
kbuild-output: ${{ env.KBUILD_OUTPUT }}
167+
image-output: 'root.img'
159168
- name: Tar artifacts
160169
run: |
161170
file_list=""
@@ -170,14 +179,9 @@ jobs:
170179
fi
171180
# zstd is installed by default in the runner images.
172181
tar -cf - \
173-
"${KBUILD_OUTPUT}"/.config \
174-
"${KBUILD_OUTPUT}"/$(KBUILD_OUTPUT="${KBUILD_OUTPUT}" make -s image_name) \
175-
"${KBUILD_OUTPUT}"/include/config/auto.conf \
176-
"${KBUILD_OUTPUT}"/include/generated/autoconf.h \
177-
"${KBUILD_OUTPUT}"/vmlinux \
178182
${file_list} \
179-
--exclude '*.h' \
180-
selftests/bpf/ | zstd -T0 -19 -o vmlinux-${{ matrix.arch }}-${{ matrix.toolchain }}.tar.zst
183+
root.img \
184+
vmlinuz | zstd -T0 -19 -o vmlinux-${{ matrix.arch }}-${{ matrix.toolchain }}.tar.zst
181185
- uses: actions/upload-artifact@v3
182186
with:
183187
name: vmlinux-${{ matrix.arch }}-${{ matrix.toolchain }}
@@ -205,23 +209,14 @@ jobs:
205209
- name: Untar artifacts
206210
# zstd is installed by default in the runner images.
207211
run: zstd -d -T0 vmlinux-${{ matrix.arch }}-${{ matrix.toolchain }}.tar.zst --stdout | tar -xf -
208-
- name: Prepare rootfs
209-
uses: libbpf/ci/prepare-rootfs@master
210-
with:
211-
project-name: 'libbpf'
212-
arch: ${{ matrix.arch }}
213-
kernel: ${{ matrix.kernel }}
214-
kernel-root: '.'
215-
kbuild-output: ${{ env.KBUILD_OUTPUT }}
216-
image-output: '/tmp/root.img'
217-
test: ${{ matrix.test }}
218212
- name: Run selftests
219213
uses: libbpf/ci/run-qemu@master
220214
continue-on-error: ${{ matrix.continue_on_error }}
221215
timeout-minutes: ${{ matrix.timeout_minutes }}
222216
with:
223217
arch: ${{ matrix.arch}}
224-
img: '/tmp/root.img'
218+
img: '${{ github.workspace }}/root.img'
225219
vmlinuz: '${{ github.workspace }}/vmlinuz'
226220
kernel-root: '.'
227221
max-cpu: 8
222+
kernel-test: ${{ matrix.test }}

0 commit comments

Comments
 (0)