Update BTFHub Archive #984
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update BTFHub Archive | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
workflow_dispatch: {} | |
jobs: | |
amazon-update: | |
name: Update Amazon 2 BTF Archive | |
runs-on: ubuntu-latest | |
container: | |
image: amazonlinux:2 | |
steps: | |
- name: Install needed amazon packages | |
run: | | |
yum install -y yum-utils tar gzip xz clang make cmake git libdwarf-devel elfutils-libelf-devel elfutils-devel | |
yum-config-manager -y --enable amzn2-core-debuginfo | |
# yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo | |
# yum install -y gh | |
echo "[amzn2-core-debuginfo-alt]" >> /etc/yum.repos.d/amzn2-core.repo | |
awk '/^\[/{found=""} /^\[amzn2-core-debuginfo]$/{found=1;next} found && NF' /etc/yum.repos.d/amzn2-core.repo | sed 's/\$basearch/aarch64/g' >> /etc/yum.repos.d/amzn2-core.repo | |
shell: bash | |
# | |
- name: Check out BTFHub | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: aquasecurity/btfhub | |
path: ./btfhub | |
# | |
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | |
with: | |
go-version: '1.20' | |
# | |
- name: build pahole | |
run: | | |
cd ./3rdparty/dwarves | |
mkdir build | |
cd build | |
cmake -D__LIB=lib -DDWARF_INCLUDE_DIR=/usr/include .. | |
make install | |
echo "/usr/local/lib" >> /etc/ld.so.conf.d/pahole.conf | |
ldconfig | |
shell: bash | |
# | |
- name: Compile BTFHub Tool | |
run: | | |
make | |
shell: bash | |
# | |
- name: Checkout BTFHub Archive | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: aquasecurity/btfhub-archive | |
token: ${{ secrets.GEYSLAN_BTFHUB_PAT }} | |
persist-credentials: false | |
fetch-depth: 1 | |
path: ./btfhub-archive | |
sparse-checkout: | | |
amzn | |
# | |
- name: Fetch and Generate new BTFs (AMAZON 2) | |
run: | | |
cd btfhub | |
./btfhub -workers 6 -d amzn -r 2 | |
# | |
- name: Check Status | |
run: | | |
cd btfhub-archive | |
git status | |
# | |
- name: Commit and Push to BTFHub Archive | |
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5 | |
with: | |
directory: ./btfhub-archive | |
author_email: '[email protected]' | |
author_name: 'Geyslan Gregório' | |
github_token: ${{ secrets.GEYSLAN_BTFHUB_PAT }} | |
message: 'Update BTFHUB Archive from BTFHUB' | |
repository: aquasecurity/btfhub-archive | |
branch: main | |
build: | |
name: Update BTF Archive | |
env: | |
HOME: "/tmp/root" | |
GOPATH: "/tmp/go" | |
GOCACHE: "/tmp/go-cache" | |
GOROOT: "/usr/local/go" | |
runs-on: | |
- graas_ami-0f4881c8d69684001_${{ github.event.number }}${{ github.run_attempt }}-${{ github.run_id }} | |
- EXECUTION_TYPE=LONG | |
steps: | |
# | |
- name: Setup Swap File | |
run: | | |
fallocate -l 16G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
shell: bash | |
# | |
- name: Check out BTFHub | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: aquasecurity/btfhub | |
path: ./btfhub | |
# | |
- name: "Prepare Image (Fix AMI)" | |
uses: ./btfhub/.github/actions/build-dependencies | |
with: | |
run-on: ./btfhub | |
from: cron | |
# | |
- name: Checkout BTFHub Archive | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
repository: aquasecurity/btfhub-archive | |
token: ${{ secrets.GEYSLAN_BTFHUB_PAT }} | |
persist-credentials: false | |
fetch-depth: 1 | |
path: ./btfhub-archive | |
# | |
- name: Bring current BTFHub Archive | |
run: | | |
cd btfhub | |
make bring | |
shell: bash | |
# | |
- name: Compile BTFHub Tool | |
run: | | |
cd btfhub | |
make | |
shell: bash | |
# | |
- name: Fetch and Generate new BTFs (UBUNTU) | |
run: | | |
cd btfhub | |
./btfhub -workers 6 -d ubuntu | |
# debian stretch seems to be gone, updates for buster and bullseye only | |
- name: Fetch and Generate new BTFs (DEBIAN) | |
run: | | |
cd btfhub | |
./btfhub -workers 6 -d debian -r buster | |
./btfhub -workers 6 -d debian -r bullseye | |
# | |
- name: Fetch and Generate new BTFs (CENTOS) | |
run: | | |
cd btfhub | |
./btfhub -workers 6 -d centos | |
# | |
- name: Fetch and Generate new BTFs (FEDORA) | |
run: | | |
cd btfhub | |
./btfhub -workers 6 -d fedora | |
# | |
- name: Fetch and Generate new BTFs (ORACLE) | |
run: | | |
cd btfhub | |
./btfhub -workers 6 -d ol | |
# | |
- name: Take new BTFs to BTFHub Archive | |
run: | | |
cd btfhub | |
make take | |
# | |
- name: Check Status | |
run: | | |
cd btfhub-archive | |
git status | |
# | |
- name: Commit and Push to BTFHub Archive | |
uses: actions-js/push@5a7cbd780d82c0c937b5977586e641b2fd94acc5 # v1.5 | |
with: | |
directory: ./btfhub-archive | |
author_email: '[email protected]' | |
author_name: 'Geyslan Gregório' | |
github_token: ${{ secrets.GEYSLAN_BTFHUB_PAT }} | |
message: 'Update BTFHUB Archive from BTFHUB' | |
repository: aquasecurity/btfhub-archive | |
branch: main |