-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2.51 KB
/
Copy pathkernel.yml
File metadata and controls
74 lines (64 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Kernel
# The guest kernel, for the same reason QEMU has its own workflow: compiling it is tens of
# minutes and the merge gate must not wait for it.
#
# It matters more than a build time, though. A changed kernel is a changed machine — the
# fingerprint hashes this binary by content — so every template taken against the previous
# one stops matching. The job prints the checksum of what it produced for exactly that
# reason: a config change whose effect nobody looked at is a fleet-wide event nobody
# noticed.
on:
# kernel/** and nothing else; see the note in qemu.yml.
push:
branches: [main]
paths:
- kernel/**
- .github/workflows/kernel.yml
pull_request:
paths:
- kernel/**
- .github/workflows/kernel.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: kernel-${{ github.head_ref || github.ref_name }}
# Never on main: a cancelled run there is a commit nobody proved.
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Task
uses: go-task/setup-task@v2
- name: Set up Buildx
uses: docker/setup-buildx-action@v4
# Ends in `task kernel:verify`, which opens the ELF and checks the Xen PVH notes
# survived the strip. Without them QEMU has no entry point into this kernel and the
# failure is a VM that does not start, in whichever lane boots one next.
- name: Build the kernel
run: |
task kernel:build \
KERNEL_CACHE_FROM=type=gha \
KERNEL_CACHE_TO=type=gha,mode=max \
KERNEL_NPROC=4
# Printed, not compared: this workflow has no way to know which checksum is the
# right one. It is here so that a pull request that changes the config shows, in its
# own log, that it changed the machine — and so that the number can be read back
# when somebody asks why their templates stopped matching.
- name: What this kernel is
run: |
echo "kernel sha256: $(sha256sum _output/kernel/vmlinux | cut -d' ' -f1)"
echo "config sha256: $(sha256sum _output/kernel/kernel-config | cut -d' ' -f1)"
- name: Upload the kernel
uses: actions/upload-artifact@v4
with:
name: vmlinux-${{ github.sha }}
path: |
_output/kernel/vmlinux
_output/kernel/kernel-config
retention-days: 30
if-no-files-found: error