Skip to content

Commit 75bb40a

Browse files
d-e-s-odanielocfb
authored andcommitted
Check vmlinux.h header up-to-dateness
Check that vmlinux.h headers in the repository are up-to-date with respect to the checked in config. Doing so should make it clear to pull request submitters that they should update headers after update of the config (or targeted kernel version or similar). We don't want to completely automate away the update, to have a human in the loop to double check sanity, e.g., for cases where config values get renamed. Signed-off-by: Daniel Müller <deso@posteo.net>
1 parent 14e66a3 commit 75bb40a

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,31 @@ jobs:
7373
EOF
7474
cargo update
7575
cargo check --tests
76+
generate-headers:
77+
name: Generate vmlinux.h headers
78+
uses: ./.github/workflows/vmlinux.h.yml
79+
check-headers:
80+
name: Check headers are up to date
81+
runs-on: ubuntu-latest
82+
needs: generate-headers
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- name: Download generated headers
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: vmlinux.h
90+
path: generated-headers
91+
92+
- name: Copy headers to include/ directory
93+
shell: bash
94+
run: |
95+
# Copy each vmlinux.h file to the corresponding include/ subdirectory
96+
for dir in generated-headers/*/; do
97+
arch=$(basename "$dir")
98+
cp "$dir"vmlinux.h "include/$arch/"
99+
done
100+
101+
- name: Check for differences
102+
run: git diff --exit-code ||
103+
(echo "!!!! CHECKED IN vmlinux.h HEADER IS OUTDATED !!!!" && false)

.github/workflows/vmlinux.h.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
branches:
77
- main
88
workflow_dispatch:
9+
workflow_call:
910

1011
jobs:
1112
gen-headers:
@@ -87,8 +88,13 @@ jobs:
8788
for dir in vmlinux.h-*/; do
8889
arch="${dir#vmlinux.h-}"
8990
arch="${arch%/}"
90-
mkdir -p "vmlinux.h/$arch"
91-
mv "$dir"* "vmlinux.h/$arch/"
91+
# Map architecture names to match include/ directory structure
92+
target_arch="$arch"
93+
case "$arch" in
94+
ppc64le) target_arch="powerpc" ;;
95+
esac
96+
mkdir -p "vmlinux.h/$target_arch"
97+
mv "$dir"* "vmlinux.h/$target_arch/"
9298
done
9399
94100
- name: Upload combined headers

0 commit comments

Comments
 (0)