Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,31 @@ jobs:
EOF
cargo update
cargo check --tests
generate-headers:
name: Generate vmlinux.h headers
uses: ./.github/workflows/vmlinux.h.yml
check-headers:
name: Check headers are up to date
runs-on: ubuntu-latest
needs: generate-headers
steps:
- uses: actions/checkout@v4

- name: Download generated headers
uses: actions/download-artifact@v4
with:
name: vmlinux.h
path: generated-headers

- name: Copy headers to include/ directory
shell: bash
run: |
# Copy each vmlinux.h file to the corresponding include/ subdirectory
for dir in generated-headers/*/; do
arch=$(basename "$dir")
cp "$dir"vmlinux.h "include/$arch/"
done

- name: Check for differences
run: git diff --exit-code ||
(echo "!!!! CHECKED IN vmlinux.h HEADER IS OUTDATED !!!!" && false)
Comment thread
theihor marked this conversation as resolved.
10 changes: 8 additions & 2 deletions .github/workflows/vmlinux.h.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches:
- main
workflow_dispatch:
workflow_call:

jobs:
gen-headers:
Expand Down Expand Up @@ -87,8 +88,13 @@ jobs:
for dir in vmlinux.h-*/; do
arch="${dir#vmlinux.h-}"
arch="${arch%/}"
mkdir -p "vmlinux.h/$arch"
mv "$dir"* "vmlinux.h/$arch/"
# Map architecture names to match include/ directory structure
target_arch="$arch"
case "$arch" in
ppc64le) target_arch="powerpc" ;;
esac
mkdir -p "vmlinux.h/$target_arch"
mv "$dir"* "vmlinux.h/$target_arch/"
done

- name: Upload combined headers
Expand Down