CI: handle new ci-kernel format #185
Workflow file for this run
This file contains 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: 'bluebox CI/CD example' | |
on: | |
schedule: | |
# Run job once a week on saturday at 8:15 AM. | |
- cron: '15 8 * * 6' | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ '**' ] | |
jobs: | |
build-initramfs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout bluebox | |
uses: actions/checkout@v4 | |
- name: set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
id: go | |
- name: build initramfs | |
# Instead of installing bluebox with 'go install github.com/florianl/bluebox@VERSION' we | |
# just compile the code here and execute the resulting binary. | |
run: | | |
go build . | |
./bluebox | |
- name: upload initramfs for tests | |
# Upload the generated initramfs.cpio and make it available for the parallel per-kernel tests. | |
uses: actions/upload-artifact@v3 | |
with: | |
name: initramfs | |
path: | | |
initramfs.cpio | |
per-kernel-tests: | |
needs: build-initramfs | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
kernel-version: ["4.9", "4.14", "4.19", "5.4", "5.10", "5.15", "6.1"] | |
steps: | |
- name: install qemu && curl | |
# Make sure required software packages are available. | |
run: | | |
sudo apt --yes update | |
sudo apt --yes install qemu-system-x86 curl | |
- name: get initramfs | |
# Fetch the initramfs.cpio that was created in the previous step. | |
uses: actions/download-artifact@v3 | |
with: | |
name: initramfs | |
- name: fetch and unpack Linux kernel | |
# Fetch the public kernel image that will be used in this test run. | |
run: | | |
curl -s -L -O --fail https://github.com/cilium/ci-kernels/raw/master/linux-${{ matrix.kernel-version }}-amd64.tgz | |
tar xvf linux-${{ matrix.kernel-version }}-amd64.tgz | |
- name: run tests on kernel | |
# Run the tests. | |
run: | | |
qemu-system-x86_64 -nographic -append "console=ttyS0" -m 2G -kernel boot/vmlinuz -initrd initramfs.cpio |