Skip to content

Commit daa483f

Browse files
committed
ci: build every kernel flavour in the matrix
pr-build.yml and publish.yml now iterate the core/rt/hwe/ai flavour matrix Makefile.eve resolves, instead of building a single implicit flavour. Each leg builds with its own KERNEL_CONFIG_FLAVOR, so a fragment change that only affects hwe/ai (deny.fragment, boot.fragment) or only core/rt (rt.fragment) gets exercised, and the policy checker gate inside Dockerfile.gcc runs for every flavour on every PR rather than one.
1 parent b4ac06a commit daa483f

2 files changed

Lines changed: 134 additions & 0 deletions

File tree

.github/workflows/pr-build.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: PR Build
2+
3+
on: # yamllint disable-line rule:truthy
4+
pull_request:
5+
branches:
6+
- "gha-test-rebase"
7+
- "eve-kernel-*"
8+
paths-ignore:
9+
- ".github/**"
10+
11+
concurrency:
12+
group: pr-build-${{ github.event.pull_request.number }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
flavor: [core, rt, hwe, ai]
20+
fail-fast: false
21+
max-parallel: 3
22+
23+
runs-on: [runner-xl, X64, Linux]
24+
25+
steps:
26+
- name: Set sanitized branch name
27+
id: branch-setter
28+
run: |
29+
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
30+
SAFE_BRANCH="${BRANCH_NAME//\//-}"
31+
echo "SAFE_BRANCH=$SAFE_BRANCH" >> $GITHUB_ENV
32+
- name: Checkout PR code
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
with:
35+
ref: ${{ github.event.pull_request.head.sha }}
36+
repository: ${{ github.event.pull_request.head.repo.full_name }}
37+
fetch-depth: 1
38+
39+
- name: Build kernel flavor ${{ matrix.flavor }}
40+
run: |
41+
make -f Makefile.eve \
42+
KERNEL_CONFIG_FLAVOR=${{ matrix.flavor }} \
43+
BRANCH=$SAFE_BRANCH \
44+
kernel-gcc
45+
46+
- name: Clean
47+
if: always()
48+
run: |
49+
make -f Makefile.eve \
50+
KERNEL_CONFIG_FLAVOR=${{ matrix.flavor }} \
51+
BRANCH=$SAFE_BRANCH \
52+
clean-gcc
53+
if docker ps -q -f name=linuxkit-builder | grep -q .; then
54+
echo "=== BuildKit disk usage before prune ==="
55+
docker exec linuxkit-builder buildctl du | tail -n 2
56+
echo "=== Reclaiming ==="
57+
docker exec linuxkit-builder buildctl prune --keep-storage "${BUILDKIT_KEEP_STORAGE_MB:-32000}" | tail -n 1
58+
echo "=== BuildKit disk usage after prune ==="
59+
docker exec linuxkit-builder buildctl du | tail -n 2
60+
else
61+
echo "linuxkit-builder container not running; skipping BuildKit cleanup."
62+
fi

.github/workflows/publish.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Building and pushing Eve kernel images
2+
3+
on:
4+
push:
5+
branches:
6+
- "gha-test-rebase"
7+
- "eve-kernel-*"
8+
9+
concurrency:
10+
group: main-build-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
flavor: [core, rt, hwe, ai]
18+
fail-fast: false
19+
max-parallel: 3
20+
21+
runs-on: [runner-xl, X64, Linux]
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
ref: ${{ github.ref }}
28+
fetch-depth: 1
29+
30+
- name: Login to Docker Hub (pull)
31+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
32+
with:
33+
username: ${{ secrets.DOCKERHUB_PULL_USER }}
34+
password: ${{ secrets.DOCKERHUB_PULL_TOKEN }}
35+
36+
- name: Build kernel flavor ${{ matrix.flavor }} from ${{ github.ref_name }}
37+
run: |
38+
make -f Makefile.eve \
39+
KERNEL_CONFIG_FLAVOR=${{ matrix.flavor }} \
40+
BRANCH=${{ github.ref_name }} \
41+
kernel-gcc
42+
43+
- name: Login to Docker Hub (push)
44+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
45+
with:
46+
username: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }}
47+
password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }}
48+
49+
- name: Push ${{ matrix.flavor }} from ${{ github.ref_name }}
50+
run: |
51+
make -f Makefile.eve \
52+
KERNEL_CONFIG_FLAVOR=${{ matrix.flavor }} \
53+
BRANCH=${{ github.ref_name }} \
54+
push-gcc
55+
56+
- name: Clean
57+
if: always()
58+
run: |
59+
make -f Makefile.eve \
60+
KERNEL_CONFIG_FLAVOR=${{ matrix.flavor }} \
61+
BRANCH=${{ github.ref_name }} \
62+
clean-gcc
63+
if docker ps -q -f name=linuxkit-builder | grep -q .; then
64+
echo "=== BuildKit disk usage before prune ==="
65+
docker exec linuxkit-builder buildctl du | tail -n 2
66+
echo "=== Reclaiming ==="
67+
docker exec linuxkit-builder buildctl prune --keep-storage "${BUILDKIT_KEEP_STORAGE_MB:-32000}" | tail -n 1
68+
echo "=== BuildKit disk usage after prune ==="
69+
docker exec linuxkit-builder buildctl du | tail -n 2
70+
else
71+
echo "linuxkit-builder container not running; skipping BuildKit cleanup."
72+
fi

0 commit comments

Comments
 (0)