From ac4e27ccde7b55dcc6055c97fb16e2bc082b9bd0 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 18 Apr 2023 09:14:11 +0200 Subject: [PATCH] update(ci): add an arm test CI job. Signed-off-by: Federico Di Pierro --- .github/workflows/ci.yml | 78 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79631af2..ef36c88f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,84 @@ concurrency: cancel-in-progress: true jobs: + test-build-bpf-skeleton-arm: + runs-on: [self-hosted, linux, ARM64] + container: fedora:latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + path: source + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Install build dependencies + run: | + mkdir deps && cd deps + dnf install -y bpftool ca-certificates cmake make automake gcc gcc-c++ kernel-devel clang git pkg-config autoconf automake libbpf-devel + + - name: Build modern BPF skeleton + run: | + cd source + mkdir skeleton-build && cd skeleton-build + cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_FALCO_MODERN_BPF=ON -DCREATE_TEST_TARGETS=Off .. + make ProbeSkeleton -j6 + + - name: Upload skeleton + uses: actions/upload-artifact@v3 + with: + name: bpf_probe.skel.h + path: ${{ github.workspace }}/source/skeleton-build/skel_dir/bpf_probe.skel.h + + test-build-arm64: + runs-on: [self-hosted, linux, ARM64] + needs: test-build-bpf-skeleton-arm + container: centos:7 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Download skeleton + uses: actions/download-artifact@v3 + with: + name: bpf_probe.skel.h + path: /tmp + + - name: Install deps + run: | + yum -y install centos-release-scl + yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ + source /opt/rh/devtoolset-9/enable + yum install -y git wget make m4 rpm-build + + - name: Install updated cmake + run: | + curl -L -o /tmp/cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz + gzip -d /tmp/cmake.tar.gz + tar -xpf /tmp/cmake.tar --directory=/tmp + cp -R /tmp/cmake-3.22.5-linux-$(uname -m)/* /usr + rm -rf /tmp/cmake-3.22.5-linux-$(uname -m) + + - name: Build Falco packages + run: | + mkdir build && cd build + source /opt/rh/devtoolset-9/enable + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DUSE_BUNDLED_DEPS=On \ + -DFALCO_ETC_DIR=/etc/falco \ + -DBUILD_FALCO_MODERN_BPF=ON \ + -DMODERN_BPF_SKEL_DIR=/tmp \ + -DBUILD_DRIVER=Off \ + -DBUILD_BPF=Off \ + .. + make falco -j6 + make package + build-minimal: runs-on: ubuntu-20.04 steps: