From 2f67809032a7df17101623b38f42081bf079c4a0 Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:13:29 -0800 Subject: [PATCH 1/5] feat(cicd): run kselftests on PR and real builds --- .github/workflows/kernel-build.yml | 45 ++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index 5fa4708..d0fd23b 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -23,7 +23,7 @@ jobs: setup: name: Setup runs-on: ubuntu-26.04 - environment: Build + environment: ${{ github.event_name == 'pull_request' && 'TestBuild' || 'Build' }} outputs: need_build: ${{ steps.calculate_buildid.outputs.need_build }} current_upstream_version_plus_release: ${{ steps.get_upstream_version.outputs.current_upstream_version_plus_release }} @@ -31,6 +31,7 @@ jobs: upstream_commit: ${{ steps.get_upstream_version.outputs.upstream_commit }} steps: - name: Read env variables + if: github.event_name != 'pull_request' id: env_variables env: GH_TOKEN: ${{ secrets.VARS_TOKEN }} # has Environments RW @@ -126,7 +127,7 @@ jobs: name: Build RPM timeout-minutes: 300 needs: buildsrpm - environment: Build + environment: ${{ github.event_name == 'pull_request' && 'TestBuild' || 'Build' }} strategy: fail-fast: false matrix: @@ -159,14 +160,20 @@ jobs: rm -rf /host/*/* df -h / dnf update -y - dnf install rpm-build mock pesign nss-tools acl -y + dnf install rpm-build mock pesign nss-tools acl openssl -y - name: Load key into pesign env: SECUREBOOT_P12: ${{ secrets.SECUREBOOT_P12 }} + EVENT_NAME: ${{ github.event_name }} run: | umask 077 - printenv SECUREBOOT_P12 | base64 -d > secureboot.p12 + if [[ "${EVENT_NAME}" == "pull_request" ]]; then + openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj "/CN=secureblue test key/" -keyout key.pem -out cert.pem + openssl pkcs12 -export -name secureblue -inkey key.pem -in cert.pem -passout pass: -out secureboot.p12 + else + printenv SECUREBOOT_P12 | base64 -d > secureboot.p12 + fi pk12util -d /etc/pki/pesign -i secureboot.p12 -W "" shred -u secureboot.p12 install -d -m 0770 -o pesign -g mock /run/pesign @@ -192,6 +199,7 @@ jobs: unshare --net -- runuser -u builder -- mock "${build_args[@]}" --offline --no-clean --rebuild kernel-*.src.rpm - name: Verify sb sig + if: github.event_name != 'pull_request' run: | dnf install sbsigntools cpio -y rpm2cpio kernel-core-*.rpm | cpio -id @@ -222,10 +230,37 @@ jobs: compression-level: 0 retention-days: 7 + kernel-selftests: + name: Run kernel tests + needs: buildrpm + runs-on: ubuntu-26.04 + continue-on-error: true + permissions: + contents: read + steps: + - name: Retrieve RPM + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: rpm-artifact-x86_64 + + - uses: lima-vm/lima-actions/setup@55627e31b78637bf254a8b2a14da8ea7d12564e5 # v1.1.0 + + - name: Run selftests + run: | + limactl start -y --name=default template:fedora-45 + lima sudo dnf install -y kernel-*.x86_64.rpm + lima sudo sh -c 'grubby --set-default /boot/vmlinuz-*.secureblue.*.x86_64' + limactl stop default + limactl start default + lima uname -r | grep secureblue + lima sudo /usr/libexec/kselftests/run_kselftest.sh -s -f | tee kselftest.log + grep '^# Totals' kselftest.log >> "${GITHUB_STEP_SUMMARY}" + pushrpm: name: Push RPM runs-on: "ubuntu-26.04" environment: Publish + if: github.event_name != 'pull_request' container: image: "fedora:45@sha256:aacbc26b38361ba0cb3d10f268da40b61b36aed6ed6fe5831a35871636bedb06" needs: [ buildrpm, setup ] @@ -372,7 +407,7 @@ jobs: notify-failure: name: Notify Discord webhook of failure - if: failure() + if: failure() && github.event_name != 'pull_request' needs: [setup, buildsrpm, buildrpm, pushrpm, release, provenance] runs-on: ubuntu-26.04 environment: Notify From 69908b6bd17bff4c6492cea4f55b6873bc456bbd Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:14:36 -0800 Subject: [PATCH 2/5] whitespace --- .github/workflows/kernel-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index d0fd23b..2472959 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -171,7 +171,7 @@ jobs: if [[ "${EVENT_NAME}" == "pull_request" ]]; then openssl req -x509 -newkey rsa:2048 -nodes -days 1 -subj "/CN=secureblue test key/" -keyout key.pem -out cert.pem openssl pkcs12 -export -name secureblue -inkey key.pem -in cert.pem -passout pass: -out secureboot.p12 - else + else printenv SECUREBOOT_P12 | base64 -d > secureboot.p12 fi pk12util -d /etc/pki/pesign -i secureboot.p12 -W "" From f17df9e4aa8d2187661a568ad9f03d0299263975 Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:16:47 -0800 Subject: [PATCH 3/5] fix --- .github/workflows/kernel-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index 2472959..8462057 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -3,6 +3,7 @@ name: kernel-build on: schedule: - cron: "5 */6 * * *" # every 6 hours + pull_request workflow_dispatch: inputs: debug_kernels: @@ -10,8 +11,8 @@ on: type: boolean default: false concurrency: - group: kernel-build - cancel-in-progress: false + group: kernel-build-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: {} From e1ab7493909fbd31ec79dcd3599c25c2c211fb8f Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:17:22 -0800 Subject: [PATCH 4/5] colon --- .github/workflows/kernel-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index 8462057..b046487 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -3,7 +3,7 @@ name: kernel-build on: schedule: - cron: "5 */6 * * *" # every 6 hours - pull_request + pull_request: workflow_dispatch: inputs: debug_kernels: From 4c3b81fc19c42ae6617879bed1e941c8ad7bd617 Mon Sep 17 00:00:00 2001 From: RoyalOughtness <129108030+RoyalOughtness@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:21:07 -0800 Subject: [PATCH 5/5] notice to pr --- .github/workflows/kernel-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index b046487..3e9cadc 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -255,7 +255,9 @@ jobs: limactl start default lima uname -r | grep secureblue lima sudo /usr/libexec/kselftests/run_kselftest.sh -s -f | tee kselftest.log - grep '^# Totals' kselftest.log >> "${GITHUB_STEP_SUMMARY}" + kselftest_totals="$(grep '^# Totals' kselftest.log)" + echo "${kselftest_totals}" >> "${GITHUB_STEP_SUMMARY}" + echo "::notice title=kselftest::${kselftest_totals}" pushrpm: name: Push RPM