44 - cron : " 0 1 * * *"
55 workflow_dispatch : {}
66jobs :
7+ amazon-update :
8+ name : Update Amazon 2 BTF Archive
9+ runs-on : ubuntu-latest
10+ container :
11+ image : amazonlinux:2023
12+ steps :
13+ - name : Install needed amazon packages
14+ run : |
15+ yum install -y yum-utils tar gzip xz golang clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel rsync
16+ shell : bash
17+ #
18+ - name : Setup Amazon Debuginfo Repositories
19+ run : |
20+ # disable default debuginfo repositories
21+ yum-config-manager -y --disable amazonlinux-debuginfo
22+
23+ # add Amazon Linux 2 debuginfo repositories
24+ append_repo() {
25+ local arch=$1
26+ local repo_name="amzn2-core-debuginfo-$arch"
27+
28+ echo "[$repo_name]
29+ name=Amazon Linux 2 core repository - debuginfo packages $arch
30+ mirrorlist=http://amazonlinux.default.amazonaws.com/2/core/latest/debuginfo/$arch/mirror.list
31+ enabled=1
32+ "
33+ }
34+
35+ cat << EOF >> /etc/yum.repos.d/amazonlinux.repo
36+ $(append_repo "x86_64")
37+ $(append_repo "aarch64")
38+ EOF
39+ shell : bash
40+ #
41+ - name : Checkout BTFHub
42+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
43+ with :
44+ repository : aquasecurity/btfhub
45+ submodules : recursive
46+ path : ./btfhub
47+ #
48+ - name : Build and install pahole
49+ run : |
50+ cd btfhub/3rdparty/dwarves
51+ mkdir build
52+ cd build
53+ cmake -D__LIB=lib -DDWARF_INCLUDE_DIR=/usr/include ..
54+ make install
55+ echo "/usr/local/lib" >> /etc/ld.so.conf.d/pahole.conf
56+ ldconfig
57+ shell : bash
58+ #
59+ - name : Build and install bpftool
60+ run : |
61+ cd btfhub/3rdparty/bpftool
62+ make -C src clean
63+ CC=clang make -C src all
64+ cp ./src/bpftool /usr/sbin/bpftool
65+ make -C src clean
66+ shell : bash
67+ #
68+ - name : Compile BTFHub Tool
69+ run : |
70+ cd btfhub
71+ make
72+ shell : bash
73+ #
74+ - name : Checkout BTFHub Archive
75+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
76+ with :
77+ repository : aquasecurity/btfhub-archive
78+ token : ${{ secrets.GEYSLAN_BTFHUB_PAT }}
79+ persist-credentials : false
80+ fetch-depth : 1
81+ path : ./btfhub-archive
82+ sparse-checkout : |
83+ amzn
84+ #
85+ - name : Bring current BTFHub Archive
86+ run : |
87+ cd btfhub
88+ make bring
89+ shell : bash
90+ #
91+ - name : Fetch and Generate new BTFs (AMAZON 2)
92+ run : |
93+ cd btfhub
94+ ./btfhub -workers 6 -d amzn -r 2
95+ #
96+ - name : Take new BTFs to BTFHub Archive
97+ run : |
98+ cd btfhub
99+ make take
100+ #
101+ - name : Check Status
102+ run : |
103+ cd btfhub-archive
104+ git status
105+ #
106+ - name : Commit and Push to BTFHub Archive
107+ uses : actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5
108+ with :
109+ directory : ./btfhub-archive
110+ author_email : ' geyslan@gmail.com'
111+ author_name : ' Geyslan Gregório'
112+ github_token : ${{ secrets.GEYSLAN_BTFHUB_PAT }}
113+ message : ' Update BTFHUB Archive from BTFHUB'
114+ repository : aquasecurity/btfhub-archive
115+ branch : main
116+
7117 build :
8118 name : Update BTF Archive
9119 env :
24134 swapon /swapfile
25135 shell : bash
26136 #
27- - name : Check out BTFHub
137+ - name : Checkout BTFHub
28138 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
29139 with :
30140 repository : aquasecurity/btfhub
@@ -44,6 +154,13 @@ jobs:
44154 persist-credentials : false
45155 fetch-depth : 1
46156 path : ./btfhub-archive
157+ sparse-checkout : |
158+ centos
159+ debian
160+ fedora
161+ ol
162+ ubuntu
163+ #
47164 - name : Bring current BTFHub Archive
48165 run : |
49166 cd btfhub
@@ -56,22 +173,17 @@ jobs:
56173 make
57174 shell : bash
58175 #
59- - name : Fetch and Generate new BTFs (UBUNTU )
176+ - name : Fetch and Generate new BTFs (CENTOS )
60177 run : |
61178 cd btfhub
62- ./btfhub -workers 6 -d ubuntu
179+ ./btfhub -workers 6 -d centos
63180 # debian stretch seems to be gone, updates for buster and bullseye only
64181 - name : Fetch and Generate new BTFs (DEBIAN)
65182 run : |
66183 cd btfhub
67184 ./btfhub -workers 6 -d debian -r buster
68185 ./btfhub -workers 6 -d debian -r bullseye
69186 #
70- - name : Fetch and Generate new BTFs (CENTOS)
71- run : |
72- cd btfhub
73- ./btfhub -workers 6 -d centos
74- #
75187 - name : Fetch and Generate new BTFs (FEDORA)
76188 run : |
77189 cd btfhub
@@ -82,6 +194,11 @@ jobs:
82194 cd btfhub
83195 ./btfhub -workers 6 -d ol
84196 #
197+ - name : Fetch and Generate new BTFs (UBUNTU)
198+ run : |
199+ cd btfhub
200+ ./btfhub -workers 6 -d ubuntu
201+ #
85202 - name : Take new BTFs to BTFHub Archive
86203 run : |
87204 cd btfhub
0 commit comments