|
6 | 6 | branches: |
7 | 7 | - main |
8 | 8 | workflow_dispatch: |
| 9 | + workflow_call: |
9 | 10 |
|
10 | 11 | jobs: |
11 | 12 | gen-headers: |
12 | | - name: Generate vmlinux.h |
| 13 | + name: Generate vmlinux.h (${{ matrix.arch }}) |
13 | 14 | runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + arch: |
| 18 | + - x86_64 |
| 19 | + - aarch64 |
| 20 | + - arm |
| 21 | + - loongarch64 |
| 22 | + - ppc64le |
| 23 | + - riscv64 |
| 24 | + - s390x |
14 | 25 |
|
15 | 26 | steps: |
16 | 27 |
|
17 | 28 | - uses: actions/checkout@v4 |
18 | 29 |
|
19 | | - - name: Download Linux source |
| 30 | + - name: Check out Linux source |
| 31 | + uses: actions/checkout@v6 |
| 32 | + with: |
| 33 | + repository: 'torvalds/linux' |
| 34 | + ref: 'v6.18' |
| 35 | + fetch-depth: 1 |
| 36 | + path: linux/ |
| 37 | + |
| 38 | + - name: Check out pahole source |
| 39 | + uses: actions/checkout@v6 |
| 40 | + with: |
| 41 | + repository: 'acmel/dwarves' |
| 42 | + ref: 'next' |
| 43 | + fetch-depth: 1 |
| 44 | + path: pahole/ |
| 45 | + |
| 46 | + - name: Install pahole |
20 | 47 | shell: bash |
21 | | - run: ./scripts/download-latest-linux-release.sh |
| 48 | + run: | |
| 49 | + sudo apt -y install cmake git libdw-dev libelf-dev |
| 50 | + cd pahole |
| 51 | + mkdir -p build |
| 52 | + cmake -B=build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr |
| 53 | + make -C build -j$(nproc) |
| 54 | + sudo make -C build install |
22 | 55 |
|
23 | 56 | - name: Install dependencies |
24 | 57 | shell: bash |
25 | 58 | run: | |
26 | 59 | ./scripts/install-dependencies.sh |
27 | | - ./scripts/install-pahole.sh |
28 | 60 | ./scripts/install-bpftool.sh |
29 | 61 |
|
30 | | - - name: x86_64/vmlinux.h |
| 62 | + - name: Generate ${{ matrix.arch }}/vmlinux.h |
31 | 63 | shell: bash |
32 | | - run: ./scripts/gen-vmlinux-header.sh x86_64 |
| 64 | + run: ./scripts/gen-vmlinux-header.sh ${{ matrix.arch }} |
33 | 65 |
|
34 | | - - name: aarch64/vmlinux.h |
35 | | - shell: bash |
36 | | - run: ./scripts/gen-vmlinux-header.sh aarch64 |
37 | | - |
38 | | - - name: arm/vmlinux.h |
39 | | - shell: bash |
40 | | - run: ./scripts/gen-vmlinux-header.sh arm |
41 | | - |
42 | | - - name: loongarch64/vmlinux.h |
43 | | - shell: bash |
44 | | - run: ./scripts/gen-vmlinux-header.sh loongarch64 |
| 66 | + - name: Upload headers |
| 67 | + uses: actions/upload-artifact@v4 |
| 68 | + with: |
| 69 | + name: vmlinux.h-${{ matrix.arch }} |
| 70 | + if-no-files-found: error |
| 71 | + path: ./vmlinux.h/${{ matrix.arch }} |
45 | 72 |
|
46 | | - - name: ppc64le/vmlinux.h |
47 | | - shell: bash |
48 | | - run: ./scripts/gen-vmlinux-header.sh ppc64le |
| 73 | + combine-headers: |
| 74 | + name: Combine all vmlinux.h headers |
| 75 | + runs-on: ubuntu-latest |
| 76 | + needs: gen-headers |
49 | 77 |
|
50 | | - - name: riscv64/vmlinux.h |
51 | | - shell: bash |
52 | | - run: ./scripts/gen-vmlinux-header.sh riscv64 |
| 78 | + steps: |
| 79 | + - name: Download all artifacts |
| 80 | + uses: actions/download-artifact@v4 |
| 81 | + with: |
| 82 | + pattern: vmlinux.h-* |
53 | 83 |
|
54 | | - - name: s390x/vmlinux.h |
| 84 | + - name: Reorganize headers |
55 | 85 | shell: bash |
56 | | - run: ./scripts/gen-vmlinux-header.sh s390x |
| 86 | + run: | |
| 87 | + mkdir -p vmlinux.h |
| 88 | + for dir in vmlinux.h-*/; do |
| 89 | + arch="${dir#vmlinux.h-}" |
| 90 | + arch="${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/" |
| 98 | + done |
57 | 99 |
|
58 | | - - name: Upload headers |
| 100 | + - name: Upload combined headers |
59 | 101 | uses: actions/upload-artifact@v4 |
60 | 102 | with: |
61 | 103 | name: vmlinux.h |
|
0 commit comments